Android non-rectangular buttons, how to handle this?

I developed several buttons with photoshop, but now I had a problem how to make them work.

In principle, I have this image

My buttons

I thought of two solutions: the first one is to put them in a RelativeLayout and put them in β€œmany” indents / fields, the second solution is to cut them vertically and attach them one at a time, for example this:

My buttons2

In the second solution, I cannot use the selector, and not the entire button, at least not a big problem. With the first, I'm a little worried about scaling on different screen sizes.

Will it be a problem? What solution would you suggest?

Thanks in advance.

+4
source share
1 answer

It is not necessary that your area with a click be the same as your image shape. enter image description here

Change the onclick image ...

If your options are open to use the image view instead of the button, then the whole image will be clickable.

I searched everything to find this question similar to yours. Hope this helps.

+1
source

Source: https://habr.com/ru/post/1484398/


All Articles