Android:如何使用换行内容避免在圆形按钮的圆圈外按?

use*_*374 7 eclipse android imagebutton android-layout

任何人都可以告诉我如何避免在圆形按钮的圆圈外按压,因为"wrap_content"似乎不起作用.我使用图像文件来创建按钮.我感谢任何帮助.谢谢.

use*_*305 4

仅供您理解..(默认情况下,android View 是矩形形状,因此它也适用于 Button)

  1. 将触摸侦听器设置为按钮并在onTouch()地图中设置圆形区域的 XY 坐标。如果它位于内部区域,则执行您想要的操作,否则返回false

  2. 使用Inset查看本教程http://www.anotherandroidblog.com/2011/07/01/button-hit-area-for-custom-graphics/

  3. 实现TouchDelegates看这个教程http://www.vogella.com/blog/2012/04/15/android-using-touchdelegates/