Android开发中遇到的系统组件bug

Android开发中遇到的系统组件bug持续更新…

1. 部分版本RecycleView无法下拉刷新异常

SwipeRefreshLayout 嵌套 RecycleView隐藏第一项holder.itemView.setVisibility(View.GONE)导致嵌套在SwipeRefreshLayout中导致无法下拉刷新, 解决方案隐藏项使用

ViewGroup.LayoutParams params = holder.itemView.getLayoutParams();
if (显示) {//显示当前项
            params.height = ViewGroup.LayoutParams.WRAP_CONTENT;
            holder.itemView.setLayoutParams(params);
         } else {//隐藏当前项
            params.height = 0;
            holder.itemView.setLayoutParams(params);
         }

2. Support包版本24.0.0-alpha1RecycleView异常

使用24.0.0-alpha1的support包导致RecycleView每一项的布局文件最外层如果使用match_parent, 则每一项都可能被撑开以至于占据整个屏幕高度,解决方法使用wrap_content 或者指定 24.0.0-alpha1之前的包

3. TextView竖直滚动问题

在设置了 android:maxLines=”3” 和 android:autoLink=”all” 之后导致文字会上下滚动

<TextView
          android:id="@+id/content"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical"
          android:autoLink="all"
          android:ellipsize="end"
          android:gravity="center_vertical"
          android:maxLines="3"
          android:paddingLeft="@dimen/space_normal"
          android:paddingRight="@dimen/space_normal"
          android:text=""
          android:textColor="#666666"
          android:textColorLink="@color/linked"
          android:textSize="16sp"
          />
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值