문제가있는 확장 된 공간을 사용자 정의 색상이나 그라데이션으로 채우고 싶습니다. 그러나 RecyclerView는 항목 사이에 빈 공간을 남겨서 행을 확장하여 흰색 배경 (스크린 샷) 또는 배경색을 보는 결과를 가져옵니다. 빈 공간은 onBindViewHolder가 호출되는 확장 애니메이션 후에 채워집니다.Recycler보기 notifyItemInserted 빈 공간
어떻게 든이 빈 공간을 사용자 정의보기로 채울 수 있습니다. 따라서 색상이 깜박 거리지 않고 멋지게 쪼그라 들게됩니다.
리스너를 애니메이션에 첨부하고 그 시간 동안 가상보기로 오버레이 할 수있는 방법이 있습니까?
아이 뷰가 도시되어직전 : 요청한 RecyclerView의 XML에 추가 : 아이 뷰 EDIT가
(그룹 확장) 도시
후
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
style="@style/myRecyclerViewStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</FrameLayout>
group_item.xml
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/list_group_item_height"
android:background="@android:color/holo_green_light"
android:clickable="true"
android:foreground="?attr/selectableItemBackground">
<TextView
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
</FrameLayout>
child_item.xml 나는 그것 여전히 같은를 wrap_content 모든 높이를 변경하더라도
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/list_item_height"
android:background="@android:color/holo_green_light"
android:clickable="true">
<TextView
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"/>
</FrameLayout>
는 recyclerView의 애니메이션은 전망을 epxands과 (빈 공간 나뭇잎 배경), 나는 어떻게 든 채우고 싶다.
이
이 라이브러리에서 가져온 것입니다 : https://github.com/h6ah4i/android-advancedrecyclerview
당신의 XML 파일을 게시 –
@ PratikPopat RecyclerView의 XML을 추가했습니다. – box
및 항목 레이아웃? –