Bug系列:ScrollView嵌套RecyclerView出现item显示不全的问题

问题场景展示:


item显示不全.png

我的界面中新手必看RecyclerView中的item超过了4个,所以显示不全。
我的解决方法:

   <com.zhy.autolayout.AutoRelativeLayout
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:descendantFocusability="blocksDescendants">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/lrv_hot_question"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="20px"
                android:background="@color/app_bg"
                android:paddingStart="20dp"
                android:paddingEnd="20dp" />

 </com.zhy.autolayout.AutoRelativeLayout>

将RecyclerView外层使用RelativeLayout布局包裹并使用了
android:descendantFocusability="blocksDescendants"属性
参考来自:https://www.jianshu.com/p/d7db22a62e06

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容