Can anyone tell me how to avoid presses outside the circle of a round button since "wrap_content" doesn't seem to work. I used an image file to create the button. I appreciate any help. Thanks.
Only for Your understanding.. (By default android View is in Rectangle shape so it apply same for Button)
Set Touch Listener to your button and in onTouch()
map X-Y co-ordinates for Circle area.
If it lies in inside area do what you want else return false.
Use Inset
look at this tutorial http://www.anotherandroidblog.com/2011/07/01/button-hit-area-for-custom-graphics/
Implement TouchDelegates look at this tutorial http://www.vogella.com/blog/2012/04/15/android-using-touchdelegates/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With