밍쯔와 안작고 안귀여운 에러들🖤
[Android/Java] 중첩 RecyclerView의 이미지 clip 본문
[상황]
- RecyclerView 안에 RecyclerView가 있음.
- 내부 recyclerview의 바인딩된 이미지가 외부 recyclerview 틀 밖으로 튀어나옴. (모서리)
[해결]
- 외부 recyclerview의 BindViewHolder에 Clip하는 코드 추가
@Override
public void onBindViewHolder(OneClickViewHolder holder, int index) {
...
holder.itemView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
holder.itemView.setClipToOutline(true);
...
}
[참고]
https://stackoverflow.com/questions/5574212/android-view-clipping
Android View Clipping
Is there any way to define the clip region of a ViewGroup in android (Honeycomb)? For example, I have a ListView with an image background that has rounded corners. As I scroll through the list, the
stackoverflow.com
https://stackoverflow.com/questions/50466396/recyclerview-dont-clip-item-in-the-corner
RecyclerView don't clip item in the corner
I want to make recyclerView round corner but seem like if the child item has background color, it will cover to the recyclerView and couldn't be clipped. Here is the design If I remove the background
stackoverflow.com
'Develop > Android | iOS' 카테고리의 다른 글
[Android/Java] RecyclerView의 item 드래그앤드롭(drag&drop) + (swpie&dismiss) (0) | 2022.06.23 |
---|---|
[Android/Java] SlidingUpPanelLayout 배경/outside 레이아웃 클릭 닫힘 (0) | 2022.06.16 |
[Android/Java] Databinding, RecyclerView, Retrofit (0) | 2022.06.03 |
[Android/Java] RecyclerView의 scroll event 스크롤 이벤트 (0) | 2022.05.19 |
[Android] MVVM 모델 자료 (0) | 2022.05.18 |