Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 个具有 AnimationDrawable 背景的 ImageView,可以在您单击它时为框的打开和关闭设置动画。这 2 个图像略微重叠(透明区域),因此它们可以靠得更近。
这导致的问题是我无法单击第二张图像(透明区域)重叠的第一张图像的区域。
有没有办法设置 ImageView 的可点击区域?
我认为您不能像在带有地图的 HTML 中那样“在 ImageView 上定义可点击区域”。IMO 你能做的最好的事情就是在你的上面画一个ImageView相同大小的画布,并给它一个onClick方法。现在,我不知道一切,所以也许我错了。
ImageView
onClick