Android Question Divide buttons on a panel

Philip Prins

Active Member
Licensed User
Longtime User
What is the best way to divide 3 x 6 buttons on a panel that can be used on different tablet screen sizes?
I tried the ticktactoe example but it is not working fine on different resolutions.

Is there a library or another tool available?

Regards
Philip
 
How do you add the panel and then the buttons?
In the Designer or in code?
You have to divide the Panel.Width by 6 for the Button.Width and and divide Panel.Height by 3 for the Button.Height and then set the Left, Top, Width and Height properties of the Buttons.
 
Upvote 0
And if you have gaps between buttons or along the margins take those into account too.
 
Upvote 0
This is just a quick and dirty one
Try to elaborate on it.
A better (more elegant) approach could be to introduce the concept of "row", where each row is a panel on its own where you place 3 buttons appropriately anchored to it.
I'll be away from my PC for a couple of hours. Read you later.
 

Attachments

Upvote 0
Back
Top