- 博客(8)
- 收藏
- 关注
原创 Android ImageView的scaleType属性
center 保持原图的大小,显示在ImageView的中心。当原图的size大于ImageView的size时,多出来的部分被截掉。 center_inside 以原图正常显示为目的,如果原图大小大于ImageView的size,就按照比例缩小原图的宽高,居中显示在ImageView中。如果原图size小于ImageView的size,则不做处理居中显示图片。 center_crop ...
2018-08-23 16:51:16 118
原创 andorid shape
<?xml version="1.0" encoding="utf-8"?><!-- shape drawable xml文件中定义的一个几何图形,定义在res/drawable/目录下,文件名filename称为访问的资源ID 在代码中通过R.drawable.filename进行访问,在xml文件中通过@[package:]drawable/filename...
2018-08-23 16:45:02 120
原创 html中点击<a>链接,页面跳到顶部的问题
1.点击链接,页面滚动条跳到顶部的解决办法:&lt;a href="#"&gt;改为&lt;a href="###"&gt;2.点击链接,调用JS,页面滚动条跳到顶部的解决办法:&lt;a href="#" onclick="javascript:method();&q
2018-08-15 17:47:11 8967 1
原创 Android WebView文件上传(关键代码)
WebChromeClient webChromeClient = new WebChromeClient() { @Override public void onProgressChanged(WebView webView, int i) { super.onProgressChanged(webView, i); }...
2018-08-15 15:37:14 1768
原创 Android与H5交互
h5调用回调的线程不是主线程@JavascriptInterfacepublic void back(){ //不是主线程}
2018-08-13 15:25:31 126
原创 Android Json-判断json是JSONObject还是JSONArray
通过JSONTokener来判断json是JSONObject还是JSONArraypublic static String getJsonJointString(String top, String jsonStr) { StringBuffer sb = new StringBuffer(); try { Object objec...
2018-08-13 10:28:16 3330
原创 TextView跑马灯-xml
<TextView ...... android:ellipsize="marquee" android:marqueeRepeatLimit="marquee_forever" android:focusableInTouchMode="true" android:focusable="true" android:singleLine="tr...
2018-08-13 10:22:14 236
原创 加载更多的RecyclerView的Adapter - LoadMoreAdapter
public abstract class LoadMoreAdapter<B> extends RecyclerView.Adapter<RecyclerView.ViewHolder> { protected List<B> datas; private int page = 1; //标记底部显示状态 protected i...
2018-08-07 16:33:25 1046
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人