2016-08-05 2 views
0

CoordinatorLayout 아래에있는 RelativeLayout 안에 두 개의 RecyclerView를 삽입하려고합니다.CoordinatorLayout 아래에 두 개의 RecyclerView가 있습니다.

이것은 내 코드입니다.

<?xml version="1.0" encoding="utf-8"?> 

    <android.support.design.widget.CoordinatorLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true"> 

    <android.support.design.widget.AppBarLayout 
     android:id="@+id/appbar" 
     android:layout_width="match_parent" 
     android:layout_height="350dp" 
     android:fitsSystemWindows="true" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsing_toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true" 
     app:contentScrim="?attr/colorPrimary" 
     app:expandedTitleMarginBottom="30dp" 
     app:expandedTitleMarginEnd="50dp" 
     app:expandedTitleMarginStart="30dp" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed"> 

    <ImageView 
     android:id="@+id/imageView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:contentDescription="@null" 
     android:fitsSystemWindows="true" 
     android:scaleType="centerCrop" 
     app:layout_collapseMode="parallax"/>  

    <android.support.v7.widget.Toolbar 
     android:id="@+id/toolbar" 
     android:layout_width="match_parent" 
     android:layout_height="?attr/actionBarSize" 
     app:layout_collapseMode="pin"/> 

    </android.support.design.widget.CollapsingToolbarLayout> 
    </android.support.design.widget.AppBarLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"> 

    <include 
     android:id="@+id/details" 
     layout="@layout/adapter_details"/>  

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recycler_view" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/details"/> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recycler_view2" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/recycler_view"/> 

    </RelativeLayout>    

    <android.support.design.widget.FloatingActionButton 
     android:id="@+id/fab" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_margin="10dp" 
     app:layout_anchor="@+id/appbar" 
     app:layout_anchorGravity="bottom|right|end"/> 

    </android.support.design.widget.CoordinatorLayout> 

앱을 실행하면 두 번째 RecyclerView 인 recycler_view2가 표시되지 않습니다. 왜? 어떻게 해결할 수 있습니까?

+0

무엇을 이미 시도 했습니까? 자세한 정보를 제공해주십시오. – Odrai

+0

리사이클 뷰에 두 개가 채워지는 것이 무엇입니까? – Moulesh

+0

@Odrai : 단순히 두 개의 RecyclerViews에 사용자 정의 오브젝트 (@Moulesh)의 ArrayList를 채우려고했지만 recycler_view2가 나타나지 않고 recycler_view가 나타납니다. –

답변

0
You can try 

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



    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recycler_view" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/details"/> 

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/recycler_view2" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_below="@+id/recycler_view"/> 

    </LinearLayout> 

     </ScrollView> 

    </android.support.v4.widget.NestedScrollView> 
관련 문제