且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在一个圆圈按钮

更新时间:2023-02-09 20:32:00

这形象可能是太复杂的复制与多个视图。你能做的***的事情可能是只延长查看的ImageView ,然后重写 onTouch 方法。

That image is probably way too complex to replicate with multiple views. The best thing you could do would probably be to just extend a View or ImageView, and then override the onTouch method.

在onTouch你可以触摸的准确XY坐标,它与所有的个人可点击区域的已知界限进行比较。根据哪个区你点击你可以采取不同的操作。

In onTouch you can get the exact XY coordinates of the touch, and compare it with the known boundaries of all the individual clickable areas. Based on what area you click you can take a different action.