smartRefresh嵌套多个RecycleView滑动冲突及布局显示不全

当ScrollIView内部只有一个RecyclerView的时候

<?xml version="1.0" encoding="utf-8"?>




        <TextView
            android:id="@+id/header_view"
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:gravity="center"
            android:text="这个是RecyclerView"
            android:textColor="#000"
            android:textSize="24sp"/>
    </LinearLayout>

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</LinearLayout>

当ScrollIView内部有多个RecyclerView的时候

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <!--其它的View-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:id="@+id/header_view"
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:gravity="center"
            android:text="这个是RecyclerView"
            android:textColor="#000"
            android:textSize="24sp"/>

    </LinearLayout>


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:descendantFocusability="blocksDescendants"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view_one"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:nestedScrollingEnabled="false"
            >

        </android.support.v7.widget.RecyclerView>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:descendantFocusability="blocksDescendants"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view_two"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginBottom="30dp"
            android:layout_marginTop="30dp"
            android:nestedScrollingEnabled="false">


        </android.support.v7.widget.RecyclerView>
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:descendantFocusability="blocksDescendants"
        android:focusable="true"
        android:focusableInTouchMode="true">

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recycler_view_three"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:nestedScrollingEnabled="false">


        </android.support.v7.widget.RecyclerView>
    </RelativeLayout>
</LinearLayout>

当ScrollIView内部只有一个RecyclerView的时候并且外部嵌套上下拉刷新控件

<?xml version="1.0" encoding="utf-8"?>

<com.scwang.smartrefresh.layout.SmartRefreshLayout
    android:id="@+id/smart_refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:srlEnableHeaderTranslationContent="false"
    app:srlEnableLoadmore="true"
    >

    <com.scwang.smartrefresh.header.MaterialHeader
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <!--其它的View-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:id="@+id/header_view"
                    android:layout_width="match_parent"
                    android:layout_height="80dp"
                    android:gravity="center"
                    android:text="这个是RecyclerView"
                    android:textColor="#000"
                    android:textSize="24sp"/>

            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:descendantFocusability="blocksDescendants"
                android:focusable="true"
                android:focusableInTouchMode="true">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:nestedScrollingEnabled="false"
                    >

                </android.support.v7.widget.RecyclerView>
            </RelativeLayout>
        </LinearLayout>
    </ScrollView>

    <com.scwang.smartrefresh.layout.footer.ClassicsFooter
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

当ScrollIView内部有多个RecyclerView的时候并且外部嵌套上下拉刷新控件

<?xml version="1.0" encoding="utf-8"?>

<com.scwang.smartrefresh.layout.SmartRefreshLayout
    android:id="@+id/smart_refresh_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:srlEnableHeaderTranslationContent="false"
    app:srlEnableLoadmore="true"
    >

    <com.scwang.smartrefresh.header.MaterialHeader
        android:id="@+id/header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

    <ScrollView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <!--其它的View-->
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <TextView
                    android:id="@+id/header_view"
                    android:layout_width="match_parent"
                    android:layout_height="80dp"
                    android:gravity="center"
                    android:text="这个是RecyclerView"
                    android:textColor="#000"
                    android:textSize="24sp"/>

            </LinearLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:descendantFocusability="blocksDescendants"
                android:focusable="true"
                android:focusableInTouchMode="true">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_view_one"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:nestedScrollingEnabled="false"
                    >

                </android.support.v7.widget.RecyclerView>
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:descendantFocusability="blocksDescendants"
                android:focusable="true"
                android:focusableInTouchMode="true">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_view_two"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginBottom="30dp"
                    android:layout_marginTop="30dp"
                    android:nestedScrollingEnabled="false">


                </android.support.v7.widget.RecyclerView>
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:descendantFocusability="blocksDescendants"
                android:focusable="true"
                android:focusableInTouchMode="true">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_view_three"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:nestedScrollingEnabled="false">


                </android.support.v7.widget.RecyclerView>
            </RelativeLayout>
        </LinearLayout>
    </ScrollView>

    <com.scwang.smartrefresh.layout.footer.ClassicsFooter
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值