1

I have a rather nasty request from a client , which involves making a hexagonal button. This is easy, we can create a ShapeDrawable and load it into the ImageButton/Button etc. However here is the issue, by default there is a rectangular click region that surrounds the button in android. Regardless of the shape inside the Button , the clickable region would always be a Rect.

Can I modify this behaviour ? so as to make the clickable region of my button exactly hexagonal ?

Thanks .

ElGavilan
  • 6,610
  • 16
  • 27
  • 36
Muhammad Ahmed AbuTalib
  • 4,080
  • 4
  • 36
  • 59
  • hey you can change background so that it won't be visible. if your background can be set to white than user won't know that. or you can also set shape on click of that button. – Aiyaz Parmar Nov 26 '14 at 12:06
  • 1
    Look into this `http://stackoverflow.com/questions/5008959/android-image-with-clickable-areas` – Rahul Gupta Nov 26 '14 at 12:08
  • Have you tried it? If you centre a hexagon in a square `ImageButton` or square clickable `ImageView` there won't be very much space outside of the hexagonal area. Unless the size of the hexagon takes a huge amount of screen space, the average human finger isn't going to noticebly press outside of it. – Squonk Nov 26 '14 at 12:24

0 Answers0