我在ScrollView里面创建RecyclerView和ListView,并且我得到滚动问题。滚动是跳动(无法获得平滑滚动),我知道它与ScrollView中的RecyclerView有关的问题,因为布局滚动时没有任何问题,直到ListView存在为止,但一旦RecyclerView项目进入布局,它开始猛拉(只用手指滚动,当手指脱落时没有正确的滚动)。下面是在XML当ScrollView里面的RecyclerView时的布局跳转
沿同一轴线滚动<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@+id/lv_home_dropdown"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@color/colorWhite"
android:dividerHeight="0.5dp"
android:visibility="gone"/>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/recycleView"
android:background="@color/colorWhite">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</ScrollView>
制作一个高度为wrap_content的ListView会导致各种问题。将ListView从ScrollView中移出,你的问题就会消失。 – dharms
@dharms:我需要在ListView中的内容之后跟踪RecyclerView中的数据。如果我将ListView设置为match_parent,那将是一个问题! –
您可以将该视图添加为ListView的页脚。 – dharms