问题描述:
在ScrollView中的RecyclerView会显示右侧滑块,并且在一个比较小的高度显示列表。
解决:
把ScrollView替换为NestedScrollView,并且把RecyclerView的layout_height设置为wrap_content。
为了让NestedScrollView能显示右侧滑块,需要设置android:scrollbars="vertical"。
代码如下:
<androidx.core.widget.NestedScrollView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scrollbars="vertical">
<androidx.recyclerview.widget.RecyclerView
android:layout_width="830dp"
android:layout_height="wrap_content"
/>
</androidx.core.widget.NestedScrollView>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)