How to arrange two linear layouts inside a relative layout in android?

Ajith

The attached image contain 3 layouts

  1. Relative layout
  2. Linear layout
  3. Linear layout

Both the linear layouts are of same size and are overlapped.

All i want to know is how to arrange those two linear layouts inside the relative layout so that Linear layout 1 & Linear layout 2 will have 90% of parent height. Also linear layout 1 must be aligned to the top of relative layout while linear layout 2 to the bottom of relative layout.

Any simple working solution will be appreciated.( I'm a newbie to android studio)

enter image description here

Michael Svit

From the Android documentation:

<android.support.percent.PercentRelativeLayout
         xmlns:android="http://schemas.android.com/apk/res/android"
         xmlns:app="http://schemas.android.com/apk/res-auto"
         android:layout_width="match_parent"
         android:layout_height="match_parent">
     <LinearLayout
         android:layout_width="match_parent"
         app:layout_heightPercent="90%"
         android:layout_alignParentTop="true"/>
     <LinearLayout
         android:layout_width="match_parent"
         app:layout_heightPercent="90%"
         android:layout_alignParentBottom="true"/>
 </android.support.percent.PercentRelativeLayout>

The order in which the LinearLayouts will overlap corresponds to the order in which they are defined.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Two frame layouts inside linear layout

From Dev

Is it bad using linear/relative layouts inside a constraint layout?

From Dev

How to vertically and horizontally center a linear layout inside a relative layout

From Dev

How to fit all the linear layouts one after the other in a relative layout so that it adjusts its height if more linear layouts are added

From Dev

Relative Layout with a nested Linear Layout inside. How to position the Linear layout at the bottom of the screen?

From Dev

How to set a linear layout of buttons at the top of an image (layouts in android)?

From Dev

Android complex layout linear and relative

From Dev

How to get programmatically width and height of Relative - Linear layout in android?

From Dev

Linear Layouts inside Linear Layout - recursively adding linear layouts depending on object

From Dev

Resetting the grids inside linear layouts inside Grid layout

From Dev

Android: How to set up Grid Layout inside Linear layout?

From Dev

Android - Relative layout inside ScrollView

From Dev

Android - Activity inside linear layout

From Dev

Linear Layout Or Relative Layout?

From Dev

Custom Android View displaying differently in Linear and Relative Layouts

From Dev

Custom Android View displaying differently in Linear and Relative Layouts

From Dev

Android Layout - layouts of 3 textviews inside a listview

From Dev

how to set Linearlayout Center inside relative layout in android

From Dev

how to change order of statically created layouts in a linear layout dynamically? (Android Studio)

From Dev

Two linear layouts in a layout resource file but only one displays

From Dev

Two linear layouts in a layout resource file but only one displays

From Dev

How to align icons and display texts as marquee in nested Linear and Relative layouts?

From Dev

Disable all items inside linear layout including items inside nested linear layouts

From Dev

Disable all items inside linear layout including items inside nested linear layouts

From Dev

how to center table layout inside relative layout

From Dev

how to set each layout below another layout inside relative layout in android

From Dev

how to set each layout below another layout inside relative layout in android

From Dev

how to display two time picker in Linear layout with full view in android

From Dev

How to give Space between Linear Layouts in android

Related Related

  1. 1

    Two frame layouts inside linear layout

  2. 2

    Is it bad using linear/relative layouts inside a constraint layout?

  3. 3

    How to vertically and horizontally center a linear layout inside a relative layout

  4. 4

    How to fit all the linear layouts one after the other in a relative layout so that it adjusts its height if more linear layouts are added

  5. 5

    Relative Layout with a nested Linear Layout inside. How to position the Linear layout at the bottom of the screen?

  6. 6

    How to set a linear layout of buttons at the top of an image (layouts in android)?

  7. 7

    Android complex layout linear and relative

  8. 8

    How to get programmatically width and height of Relative - Linear layout in android?

  9. 9

    Linear Layouts inside Linear Layout - recursively adding linear layouts depending on object

  10. 10

    Resetting the grids inside linear layouts inside Grid layout

  11. 11

    Android: How to set up Grid Layout inside Linear layout?

  12. 12

    Android - Relative layout inside ScrollView

  13. 13

    Android - Activity inside linear layout

  14. 14

    Linear Layout Or Relative Layout?

  15. 15

    Custom Android View displaying differently in Linear and Relative Layouts

  16. 16

    Custom Android View displaying differently in Linear and Relative Layouts

  17. 17

    Android Layout - layouts of 3 textviews inside a listview

  18. 18

    how to set Linearlayout Center inside relative layout in android

  19. 19

    how to change order of statically created layouts in a linear layout dynamically? (Android Studio)

  20. 20

    Two linear layouts in a layout resource file but only one displays

  21. 21

    Two linear layouts in a layout resource file but only one displays

  22. 22

    How to align icons and display texts as marquee in nested Linear and Relative layouts?

  23. 23

    Disable all items inside linear layout including items inside nested linear layouts

  24. 24

    Disable all items inside linear layout including items inside nested linear layouts

  25. 25

    how to center table layout inside relative layout

  26. 26

    how to set each layout below another layout inside relative layout in android

  27. 27

    how to set each layout below another layout inside relative layout in android

  28. 28

    how to display two time picker in Linear layout with full view in android

  29. 29

    How to give Space between Linear Layouts in android

HotTag

Archive