方式一xml: android:nestedScrollingEnabled="false"
<android.support.v7.widget.RecyclerView android:id="@+id/rv_lineView" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_marginTop="20dip" android:clipToPadding="false" tools:listitem="@layout/item_timeline" android:nestedScrollingEnabled="false"/>
方式二java:
rv_lineView.setNestedScrollingEnabled(false);
本文探讨了在Android开发中遇到的ScrollView嵌套RecyclerView时出现的卡顿问题,并提供了两种解决方案:一是在XML布局文件中设置android:nestedScrollingEnabled=false,二是通过Java代码调用setNestedScrollingEnabled(false)方法。这两种方法都能有效解决卡顿现象,提升用户体验。

1万+

被折叠的 条评论
为什么被折叠?



