2016-12-22 75 views
0

我想知道是否可以滚动recyclerview并滚动其他对象而不使用嵌套滚动或滚动视图?滚动recyclerview如何滚动recyclerview以外的对象

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 
    <TextView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:layout_marginTop="50dp" 
    android:layout_gravity="center" 
    android:gravity="center" 
    android:text="Text or other oject will list here" 
    android:id="@+id/info"/> 
    <android.support.v7.widget.RecyclerView 
    android:id="@+id/business_recycle" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" /> 
</LinearLayout> 
+0

检查:Android的列表视图滚动视图内 –

回答

0
<android.support.v4.widget.NestedScrollView 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical"> 

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

     <TextView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_marginTop="50dp" 
      android:layout_gravity="center" 
      android:gravity="center" 
      android:text="Text or other oject will list here" 
      android:id="@+id/info"/> 

     <android.support.v7.widget.RecyclerView 
      android:id="@+id/business_recycle" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" /> 
    </LinearLayout> 
</android.support.v4.widget.NestedScrollView> 

注:设置recyclerView.setNestedScrollingEnabled(false);编程