【发布时间】:2017-12-20 22:53:35
【问题描述】:
iv_button ImageView 上的涟漪效果可以正常工作,直到我在 wrapper ImageView 上设置背景。如何解决这个问题?
任何帮助将不胜感激。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:id="@+id/wrapper"
android:background="@color/green" //the ripple effect works without this line
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<ImageView
android:id="@+id/iv_button"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerInParent="true"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:src="@android:drawable/ic_delete" />
</RelativeLayout>
【问题讨论】:
标签: android android-layout android-view