LoginSignup
3
4

More than 3 years have passed since last update.

ScrollViewの中にRecyclerView!

Posted at

こちらの記事でScrollViewの中にListViewをぶっこむときはカスタムListViewを作ればスクロールできてよし!ってなったんだけど、あるお方の助言でRecycleViewでも簡単に実現できましたよ!!:relaxed:

movie3.gif

RecyclerViewにandroid:nestedScrollingEnabled="false"を追加するだけ!
なんと簡単なんだ。。。

<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="wrap_content"
    android:orientation="vertical">

    ・・・略・・・

    <androidx.recyclerview.widget.RecyclerView
      android:id="@+id/list_view"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:nestedScrollingEnabled="false"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintRight_toRightOf="parent" />

  </LinearLayout>

</ScrollView>

3
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4