vertical recyclerView and Horizontal recyclerview scrolling together

前端 未结 1 565
执笔经年
执笔经年 2021-01-25 04:55

in my Project I want to have two Recyclerview (first one Horizontal and second Vertical) if I scroll screen (vertically) I want both of them scroll together.

<
相关标签:
1条回答
  • 2021-01-25 05:20

    just by changing scrollview to <android.support.v4.widget.NestedScrollView you can solve your problem

    try this

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".multi.TabFragment">
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">
    
            <EditText
                android:id="@+id/searchintabbadrkurdi"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/recyclerview_id_badr_kurdish_hor"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content">
    
                    </android.support.v7.widget.RecyclerView>
            <android.support.v7.widget.RecyclerView
                        android:id="@+id/recyclerview_id_badr_kurdish"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent">
    
                    </android.support.v7.widget.RecyclerView>
    
        </LinearLayout>
    
    </android.support.v4.widget.NestedScrollView>
    
    0 讨论(0)
提交回复
热议问题