Hankkin / PageLayoutDemo

🥭一款简单的page切换 空布局、错误布局、加载布局,支持一键配置、定义,不需要xml编写
248 stars 30 forks source link

recyclerview外边嵌套NestedScrollView的时候,只要替换recyclerview这部分,替换后布局高度不对 #4

Open ghost opened 5 years ago

ghost commented 5 years ago

<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent">

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <Button
            android:id="@+id/btn_load_success"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="加载正常" />

        <Button
            android:id="@+id/btn_load_empty"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="加载为空" />

        <Button
            android:id="@+id/btn_load_error"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="加载错误" />

    </LinearLayout>

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

</LinearLayout>

</android.support.v4.widget.NestedScrollView>

Hankkin commented 5 years ago

你initPage()传入的是recycler_view么?