마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

한 화면에 리사이클러뷰 2개를 넣었는데 수직 스크롤이 안되네요

0 추천

 

위의 화면처럼 리사이클러뷰 2개를 사용합니다.

처음의 수평 리사이클러뷰는 정상적으로 스크롤이 좌우로 잘 됩니다. 그런데

문제는 아래의 수직 리사이클러뷰의 스크롤이 작동하지 않는다는 것입니다.

왜 이런 것이지 도무지 이해가 되지 않아 질문올립니다.

<android.support.constraint.ConstraintLayout 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"
    android:background="@color/white"

    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.ulimbridge.firechatting.views.ChatFragment">

    <LinearLayout
        android:id="@+id/upview"
        android:layout_width="match_parent"
        android:orientation="vertical"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:layout_height="wrap_content">
    <TextView
        android:id="@+id/tv_approachingUsers"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="10dp"
        android:text="다가온 인연"
        android:textSize="15sp"
        android:textStyle="bold"
        android:fontFamily="@font/nanum_square_r"
        />

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

    <TextView
        android:id="@+id/view_chatMessage"
        android:layout_gravity="center_horizontal"
        android:gravity="center_vertical"
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:background="#72808A"
        android:text="메시지"
        android:textStyle="bold"
        android:paddingLeft="10dp"
        android:textColor="@color/white"
        android:fontFamily="@font/nanum_square_r"
        android:textSize="15sp"
        />


    </LinearLayout>
    
    <android.support.v7.widget.RecyclerView
        android:id="@+id/chatListRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toBottomOf="@id/upview"
        />
    
</android.support.constraint.ConstraintLayout>

 

거스너 (400 포인트) 님이 2018년 4월 26일 질문

1개의 답변

0 추천
전체적으로 ConstraintLayout 내부 child들의 위치정의가 많이 이상하구요.

두번째 RecyclerView의 android:layout_height="wrap_content" 인것도 말이 안되네요.

scroll이 필요한데 wrap_content가 될 수 있을까요?
디자이너정 (42,810 포인트) 님이 2018년 4월 27일 답변
...