2017-12-20 3 views
0

iv_button에서의 파급 효과는 ImageView가 wrapper ImageView에서 배경을 설정할 때까지 잘 작동합니다. 이 문제를 해결하는 방법?ImageView가 setBackground를 가진 다른 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> 
+0

자세한 내용은 https://stackoverflow.com/questions/31393684/set-ripple-effect-on-image-view를 참조하십시오. – R2R

답변

0

xml에 배경을 설정하면 파급 효과가 사라집니다. 계속 유지하려면 스타일로 설정 한 다음 해당 스타일을 버튼에 제공해야합니다.

관련 문제