디자인 요구사항에 맞게 다음과 같은 화면을 구현해야 했다.
Figma에 디자이너의 작업물을 보며 NestedScrollView를 사용해 화면을 구현하던 중 다음과 같은 현상이 발생했다.
위와 같이 AppBarLayout 영역은 무시한 채, NestedScrollView 영역만 스크롤이 된다. (horizontal recyclerview 외 영역을 잡고 스크롤 하면 정상 작동)
binding.rvMainContentsRecommend.apply {
layoutManager = LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
addItemDecoration(SpaceItemDecoration(16))
adapter = recommendRecyclerViewAdapter
isNestedScrollingEnabled = false // nestedScrolling 적용안함
}
NestedScrollView의 상하 스크롤과 Horizontal RecyclerView의 좌우 스크롤이 깔끔하게 동작한다.