ScrollView 与 recyclerView、WebView的滑动冲突

用ScrollView 嵌套recyclerView或者WebView冲突时、可以在recyclerView或者WebView外面嵌套RelativeLayout

如:

//recyclerView
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <WebView
        android:id="@+id/webView"
        android:layout_width="match_parent"
        android:scrollbars="none"
        android:layout_height="wrap_content"/>
</RelativeLayout>
//recyclerView
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:descendantFocusability="blocksDescendants">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/color_white" />

</RelativeLayout>

猜你喜欢

转载自blog.csdn.net/xsg2357/article/details/77977504