![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
安卓
hbRyando
这个作者很懒,什么都没留下…
展开
-
安卓GRIDVIEW,在部分VIEW被遮挡后,GRIDVIEW的CHILDCOUNT会减少
安卓GRIDVIEW,在部分VIEW被遮挡后,GRIDVIEW的CHILDCOUNT会减少原创 2015-06-24 17:37:47 · 312 阅读 · 0 评论 -
android studio live templates常用的好用的live模版
1、用这种方式遍历List;for(int i = 0, listSize = list.size(); i < listSize; i++) { Object o = list.get(i);}的模版<template name="itli2" value="for (int $INDEX$ = 0, $LIST$Size = $LIST$.size(); $INDEX...原创 2018-05-22 15:31:43 · 562 阅读 · 0 评论 -
android studio live template打印带方法参数的日志
<template name="logdp" value="android.util.Log.d(TAG, $METHOD_NAME_AND_PARAMETERS$);" description="Log.d(TAG, String)" toReformat="true" toShortenFQNames="true"> <variable name="M原创 2018-05-22 15:05:56 · 937 阅读 · 0 评论 -
Grid式的listview添加Header的方法
在RecyclerView中,用StaggeredGridLayoutManager后,列表呈现grid网格样式呈现。 这个时候如果利用adapter添加一个新类型的view作为头部,就会作为网络view呈现。 这个时候可以通过设置LayoutParams.setFullSpan(true)来让头部view占用一整行,实现头部的添加原创 2017-08-29 18:15:04 · 376 阅读 · 0 评论 -
HorizontalScrollView重新layout之后自动滑动初始位置问题解决
HorizontalScrollView在重新layout时,有时候会自动滑动到其他位置,这是由于他的后代view获取到焦点导致的,来让我们从代码层面看清这个问题: @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { int childWidth = 0;原创 2017-07-03 16:40:46 · 2736 阅读 · 0 评论 -
禁止AppBarLayout滑动
private void forbidAppBarScroll(boolean forbid) { if (forbid == forbidAppBarScroll) { return; } if (forbid) { forbidAppBarScroll = true; if原创 2017-04-18 18:37:04 · 8143 阅读 · 4 评论 -
文章标题
public class AppBarTextColorController implements OnOffsetChangedListener { private final CollapsingToolbarLayout collapsingLayout; private final int expandColor; private final int collapseC原创 2017-04-18 18:35:09 · 381 阅读 · 0 评论 -
AppbarLayout中Toolbar包含了子view时设置标题颜色
public class AppBarTextColorController implements OnOffsetChangedListener { private final CollapsingToolbarLayout collapsingLayout; private final int expandColor; private final int collap原创 2017-04-18 18:33:39 · 991 阅读 · 0 评论 -
TextView java.lang.IndexOutOfBoundsException: setSpan (27 ... 37) ends beyond length 32
java.lang.IndexOutOfBoundsException: setSpan (27 … 37) ends beyond length 32 在国外有些手机有提示的功能,如果设置了filter,editText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(MAX_TEXT_INPUT_LENGTH)});这个时候如原创 2016-11-02 17:01:56 · 6157 阅读 · 0 评论 -
Retrofit2.0源码流程备忘记录
1、Retrofit.create(Class service)会创建一个动态代理的对象。return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service }, new InvocationHandler() { private final Platform p原创 2016-10-20 10:23:51 · 485 阅读 · 0 评论 -
Android switch在某些系统上不显示thumb和track的解决办法
在某些版本的系统上,thumb显示不出来,自定义的track也显示出来, 1、查看源码后得知,在某些android系统版本上,thumb的宽度是和textOn,textOff的文字宽度是一致的,是不会重新计算thumb的drawable的宽度的。为了兼容这些系统(比如4.4.2)可以在textOn中设置一些空格,点据一定的宽度,这样thumb就有一定的宽度可以显示出来了。<Switch原创 2016-10-12 16:27:06 · 5991 阅读 · 1 评论 -
Android RelativeLayout marginRight not working
The problem is in the layout’s property android:layout_width. When it is set to “wrap_content”,the android:layout_marginRight won’t working, but rather, only when it is set to “fill_parent”, the androi原创 2016-09-26 13:58:55 · 558 阅读 · 0 评论 -
安卓addView源码分析
Android把视图显示到屏幕上,从代码角度最终都是调用ViewGroup.addView方法,可以分为两类,一是初始化时添加视图,二是动态添加视图。1. 从源码角度分析添加视图的流程,以下列出其中4个addView方法 public void addView(View child) { addView(child, -1); } pub转载 2015-07-12 23:58:32 · 846 阅读 · 0 评论 -
安卓listview
Listentities;XXAdapter adapter2 = new XXtAdapter(context, entities);listview.setAdapter(adapter2);假如有以上信息@Overridepublic void onItemClick(AdapterView parent, View view, int position, lon原创 2015-06-29 17:32:14 · 588 阅读 · 0 评论