framelayout안에 recyclerview 중첩 질문입니다.

조회수 2521회

지금 framelayout 안에 linearLayout 5개가 있고 각 linearLayout마다 recyclerview가 한 개 씩 들어가있습니다. 근데 맨처음 recyclerview는 나오는데 두번째부터는 로딩만 뜨고 화면에 나오질 않습니다. 저는 ㅜㅜ 2번째 recyclerview에는 다른 viewholder, item, adapter 클래스를 만들었습니다. 혹시 viewholder, item, adapter가 하나 있고 여러개의 recyclerview에 적용할 수 있는 방법이 있을까요? ㅜㅜ

    <LinearLayout
        android:id="@+id/GainRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

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

        </android.support.v7.widget.RecyclerView>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/GainKdaRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

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

        </android.support.v7.widget.RecyclerView>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/GainWinRateRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

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

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/GainMvpRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

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

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/ClanRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

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

        </android.support.v7.widget.RecyclerView>

    </LinearLayout>

    <LinearLayout
        android:id="@+id/ClanWinRateRankingLinearLayout"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        >

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

        </android.support.v7.widget.RecyclerView>
    </LinearLayout>

</FrameLayout>
  • 여러개의 리사이클러뷰에 viewholder, item, adapter를 재활용 할 수 있는지?가 질문이라면 답은 가능하다.이고요. 리사이클러뷰에 표현되는 아이템 뷰들이 공통적으로 묶일 수 있는 요소가 있는지 판단해보세요. 이 부분은 객체 지향 프로그래밍에 대해서 전반적으로 살펴보면 좋을 것 같습니다. 알 수 없는 사용자 2016.7.28 14:29
  • ㅎㅎ 감사합니다!!! 잘 참고가 됫어요! kyudongPark 2016.7.29 10:05

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)