I'm looking the best way to create a group of four buttons.
Each button is an image. So, I think about just create a "big" square from four small images-buttons and then rotate them.
The question is: how to rotate layout in xml? Is it possible?
Is there any better way to create such group of buttons?
Thank you!
One way to do this is to create a single ImageButton, then use trigonometry to work out where the user has clicked on the circle, using data from an onClick() event and the centre of the button. This question may help: Get the co-ordinates of a touch event on Android
The ultimate answer is to use a pathshape button. Then it handles everything for you.
Create the paths with Path the shapes with Shape and the composite pathshape with Pathshape.
That way you can do it even in XML. And there's a variety of arc path methods. Check it out!
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