我已经创建了一个列表项(如图所示),其中包括一个
ImageView
(美丽的Miranda Kerr)和一个带有背景 selectableItemBackgroundBorderless
的 ImageButton
(垃圾桶图标)。
现在,当我点击垃圾桶图标时,涟漪效果会出现在ImageView
后面。
自然而然地,我希望涟漪效果能够出现在图片前面,在垃圾桶图标后面。
完整的item.xml
:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
tools:src="@drawable/cover"
/>
<ImageButton
android:id="@+id/trash_image_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:src="@drawable/translucent_trash"
android:background="?attr/selectableItemBackgroundBorderless"
/>
</FrameLayout>