I want to have this layout in my Android app.
Requirements:
I tried GridLayout
but that won't let me stretch the children across the screen. I tried RelativeLayout
without success. I tried nesting LinearLayouts
with weights, it works, but I read that nesting weights is bad for performance. And finally, I tried TableLayout
with weights, but it does not have something like "row span" like an HTML table so I cannot do the two rectangles in the bottom right corner like I want them to be (without nesting weights again).
Somebody, please help! How hard can it be? I don't know what to do here. I could implement my own ViewGroup
or something to manually implement the layout. But it feels like this is something very simple, so I should be able to use standard layouts.
You are able to use GridLayouts to do such a thing, for some help fitting the screen I suggest you look at the following: How to make a GridLayout fit screen size.
Depending on what you are doing, nested weights with a series of Linear Layouts will not harm your performance too much, however it is is something extremely large like an intricate game or something of that nature I suggest using the GridLayout.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments