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

NestedScrollView 안의 RecyclerView 높이가 0 으로 됨

0 추천
Activity

root -> ConstraintLayout (match_parent, match_parent)
        --> <include toolbar>
        --> <LinearLayout orientation="vertical">  ==> Fragment attach/detach

Fragment

root -> NestedScrollView (match_parent, match_parent, orientation="vertical")
        --> ConstraintLayout (match_parent, wrap_content)
            --> RecyclerView 1 (match_parent, wrap_content, orientation="horizontal")
            --> RecyclerView 2 (match_parent, wrap_content, orientation="vertical")

위와 같은 구조로 Activity 를 생성하면 RecyclerView 2 의 높이가 0 가 되어 아이템이 있는데도 표시되지 않는 문제가
있는데...

 

어떤 부분을 살펴보는게 나을까요?
천방지축2 (120 포인트) 님이 2020년 11월 23일 질문
먼저 NestedScrollView에 fillport="true"를 설정해 보시구요. 안되면,
ConstrintLayout을 LinearLayout(orientation="vertical")로 바꾸어 보세요.
그래도 안되면 NestedScrollView를  프레그먼트말고 Activity쪽에 배치해 보시구요.

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...