Я хочу сделать прокрутку по LinearLayout
и отключить прокрутку от RecyclerView
. Я попытался изменить LinearLayout
на NestedScrollView
, но он не работает, и я не знаю почему.Как использовать RecyclerView с NestedScrollView?
Я пробовал this question, но это не работает. Содержимое в RecyclerView можно динамически загружать из WS и это бесконечный свиток. Экран зависал при обновлении содержимого в RecyclerView.
Я видел это из твиттера, как мы можем сделать этоhttps://drive.google.com/file/d/0B2JZggeoXKKFdG1ENmZEdWFIa0k/view?usp=sharing
Пример
Это мой простой экран моего приложения, я хочу прокрутки в red
в настоящее время, и в настоящее время он прокручивает в «синий». Большое спасибо.
Код
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="16dp"
android:background="#CCC"
android:id="@+id/imageView2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Image caption"
android:background="#cbffa3"
android:padding="16dp"
android:id="@+id/textView8" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
Пытались, но не работает, содержание внутри RecyclerView не показывая
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="match_parent"
android:layout_height="160dp"
android:layout_margin="16dp"
android:background="#CCC"
android:id="@+id/imageView2" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Image caption"
android:background="#cbffa3"
android:padding="16dp"
android:id="@+id/textView8" />
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
Возможный дубликат [Как использовать RecyclerView внутри NestedScrollView?] (Http://stackoverflow.com/questions/31000081/how-to-use-recyclerview-inside-nestedscrollview) –
Я обновил свой вопрос. – Marcus