I want to make a LinearLayout
(to which I'm adding items dynamically) scrollable inside a scrollable RecyclerView
. On startup, I can see a little scrollbar initially (indicating it's a scrollable view, fades in seconds). Tried appCompat NestedScrollView as well as enabling nestedScrollingEnabled
, with no success. How can I make the LinearLayout
scrollable inside the RecyclerView
?
<FrameLayout 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">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="300dp"
android:fillViewport="true"
android:nestedScrollingEnabled="true">
<LinearLayout
android:id="@+id/playerlist_linear"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="7dp"
android:orientation="vertical">
</LinearLayout>
</ScrollView>
</FrameLayout>
RecyclerView code
<android.support.v7.widget.RecyclerView
android:id="@+id/messagesListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:nestedScrollingEnabled="false"/>
UPDATE: I found out that scrolling does indeed work, but only if I spam the mouse or tap really fast inside the scrollview. It kind of gets focused and allows scrolling as long as mouse is held down. Really strange.