最佳答案
采用RelativeLayout并按Z顺序堆叠图像,将最前面的图像保留为RelativeLayout的最后一个元素。
然后你可以做的是获取所有图像的 onClickListener 并在云图像中不执行任何操作,并将 onClick 的正文保留为空。
虽然您可以为要执行操作的图像提供适当的 onClick。
希望这有帮助
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
//hidden Image
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
//Frontmost image
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>
关于android - 如何在android中创建一个可点击的不规则形状区域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44465736/