RecyclerView внутри NestedScrollView расширен - PullRequest
0 голосов
/ 28 ноября 2018

У меня есть вопрос об использовании Recyclerview. Когда я добавляю обзор recycler внутри nestedscrollview, он расширяется, но когда он добавляет listview внутри nestedscrollview, он не расширяется. Также, когда добавляется несколько viewcycle view внутри nestedscrollview, расширяются все виды recyclerview. В чем разница междупросмотр списка и просмотр списка здесь?

пример:

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".MainActivity">

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

    <android.support.v7.widget.RecyclerView
        android:id="@+id/myrecycleview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:nestedScrollingEnabled="true"
        android:scrollbars="vertical"
        app:layoutManager="android.support.v7.widget.LinearLayoutManager"/>


    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="My Button"/>


</LinearLayout>

здесь Кнопка является видимым концом прокрутки, но

<android.support.v4.widget.NestedScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
tools:context=".MainActivity">

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

    <ListView
        android:id="@+id/mylistview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:nestedScrollingEnabled="true"
        android:scrollbars="vertical"
    />


    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="My Button"/>


</LinearLayout>

здесь кнопка не видна.

...