Android: how do I implement the following layout?

Tom van Zummeren

I want to have this layout in my Android app.

The layout I want to implement

Requirements:

  • All rectangles should distribute evenly over the entire screen
  • The two rectangles on the bottom right should have the same height (so also distributed evenly)

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.

Bedimindtricks

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I obtain the following layout in android studio

From Dev

How do I have my layout for the following

From Dev

How do I implement the following algorithm in O(1) time?

From Dev

How do I implement the following home network architecture?

From Dev

How do I implement the following algorithm in O(1) time?

From Dev

How can i do this layout in android

From Dev

How do i get the android layout to redraw?

From Dev

How do I use view in android layout?

From Dev

I want to implement following drop down feature in my iOS Application. How Can do it?

From Dev

How do I write the following OR?

From Dev

How do I create a transparent layout on Android Android 6.0 (Marshmallow)?

From Dev

How do I implement a BroadcastReceiver in a Service Class in Android?

From Dev

Android: GraphView How do I implement time in the X axis?

From Dev

How do I implement a referral module onto my android application?

From Dev

Android - How do I make the button taller in a linear layout?

From Dev

How do I adjust my layout for a chin on Android Wear?

From Dev

Android NavigationView: How do I handle / disable selection of the header layout?

From Dev

How do I make a google plus button with a custom layout in android?

From Dev

Android: How do I put a solid color rectangle in a Layout?

From Dev

How do I create overlay button in my Android layout

From Dev

How do I align a button with the bottom of an EditText in an Android layout?

From Dev

How do I refactor android code to choose layout?

From Dev

Android NavigationView: How do I handle / disable selection of the header layout?

From Dev

How do I have the same toolbar for every layout with Android?

From Dev

how do I change the android:layout_marginTop of a button?

From Dev

How do I obtain this specific screen layout for android?

From Dev

How do I manage the layout in android after the Radio button is selected?

From Dev

How do I insert layout into Android menu item row?

From Dev

How do you implement layout with the autostarting of applications in the i3 window manager?

Related Related

  1. 1

    How do I obtain the following layout in android studio

  2. 2

    How do I have my layout for the following

  3. 3

    How do I implement the following algorithm in O(1) time?

  4. 4

    How do I implement the following home network architecture?

  5. 5

    How do I implement the following algorithm in O(1) time?

  6. 6

    How can i do this layout in android

  7. 7

    How do i get the android layout to redraw?

  8. 8

    How do I use view in android layout?

  9. 9

    I want to implement following drop down feature in my iOS Application. How Can do it?

  10. 10

    How do I write the following OR?

  11. 11

    How do I create a transparent layout on Android Android 6.0 (Marshmallow)?

  12. 12

    How do I implement a BroadcastReceiver in a Service Class in Android?

  13. 13

    Android: GraphView How do I implement time in the X axis?

  14. 14

    How do I implement a referral module onto my android application?

  15. 15

    Android - How do I make the button taller in a linear layout?

  16. 16

    How do I adjust my layout for a chin on Android Wear?

  17. 17

    Android NavigationView: How do I handle / disable selection of the header layout?

  18. 18

    How do I make a google plus button with a custom layout in android?

  19. 19

    Android: How do I put a solid color rectangle in a Layout?

  20. 20

    How do I create overlay button in my Android layout

  21. 21

    How do I align a button with the bottom of an EditText in an Android layout?

  22. 22

    How do I refactor android code to choose layout?

  23. 23

    Android NavigationView: How do I handle / disable selection of the header layout?

  24. 24

    How do I have the same toolbar for every layout with Android?

  25. 25

    how do I change the android:layout_marginTop of a button?

  26. 26

    How do I obtain this specific screen layout for android?

  27. 27

    How do I manage the layout in android after the Radio button is selected?

  28. 28

    How do I insert layout into Android menu item row?

  29. 29

    How do you implement layout with the autostarting of applications in the i3 window manager?

HotTag

Archive