develop-playground / jeju-road-android

jeju-road android project 저장소
1 stars 1 forks source link

ScrollView & RecyclerView 이슈 #24

Closed junhyung0927 closed 2 years ago

junhyung0927 commented 2 years ago

ScrollView에서는 RecyclerView를 사용해서는 안된다.

이는 RecyclerView의 스크롤 동작이 제대로 먹히지 않아서다.

이에 세 가지 해결 방법이 존재한다.

  1. RecyclerView의 높이를 정적으로 할당하기
  2. RecyclerView만을 사용하여 여러 ViewType을 지정하여 처리
  3. CoordinatorLayout을 root viewGroup으로 사용한 후 커스텀 CoordinatorLayout으로 변경. 즉, CoordinatorLayout는 NestedScrollView 인터페이스를 구현하고 있어 그와 관련된 메서드를 오버라이드하여 커스텀한다.
hongbeomi commented 2 years ago

Restaurant Page

hongbeomi commented 2 years ago

참고로 스크롤 동작이 제대로 먹히는게 아닌 재활용이 되지 않아서 사용하면 안된다는 거였습니다!

hongbeomi commented 2 years ago

31 PR에서 하나의 RecyclerView안에 여러 개의 ViewType을 둠으로써 해결