It is necessary to place 9 buttons with a matrix of 3 to 3 so that they evenly occupy the entire screen and are the same size regardless of the length of the text placed on them. It seems nothing complicated, but it does not work. ((
- And what does not work? You take a cycle and draw. Is there a problem code? Or do I do? - arg
- @osrsoft, According to the rules of the forum, questions should not be limited to the decision or the completion of student assignments. Please clarify what you have done yourself and what did not work out. - Vladyslav Matviienko
- TableLayout , or GridView . The second has some problems with TextView, it is better to try the first one first. Show, indeed, the layout, with which problems - lsillarionov
2 answers
Taki is not a problem.
1) Take the LinearLayout vertical to full screen.
2) We shove 3 horizontal ones with the same width with the entire screen and zero height with a weight equal to one.
3) We shove 3 buttons each with a height equal to the height of the parent and a width of zero with a weight equal to one again.
four) ???
5) Profit !!! 11one
PS The compiler, however, can start swearing at the nested elements with a weight, but it should work.
PS You can still, in theory, play around with GridLayout , but, IMHO, I think that you can not bother with it.
For such markup the TableLayout container is ideal.
using multiple nested containers LinearLayout is not recommended for solving such a task unless absolutely necessary, as it significantly affects the performance