티스토리 뷰

반응형

https://jgeun97.tistory.com/230

 

[Android] RecyclerView 마지막 layout 잘림 현상

RecyclerView 작업을 하다보면 맨 마지막 item이 잘리는 경우가 발생합니다. 1. ConstraintLayout 으로 상위 Layout이 구성되어있는 경우 RecyclerView를 Bottom을 연결하지 않고 height에 wrap_content를 입력하여 구현

jgeun97.tistory.com

 

RecyclerView 작업을 하다보면 맨 마지막 item이 잘리는 경우가 발생합니다.

 

1. ConstraintLayout 으로 상위 Layout이 구성되어있는 경우

 

RecyclerView를 Bottom을 연결하지 않고 height에 wrap_content를 입력하여 구현하는 경우 바닥이 잘리게 됩니다.

android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"

이럴 때는 layout_height="wrap_content"  로 선언 후 bottom을 연결해주면 해결됩니다.

 

android:layout_height="wrap_content"

 

 

 

layout_constrainedHeight="true"를 추가적으로 넣어주시면 해결됩니다

app:layout_constrainedHeight="true"

 

 

반응형
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함