Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Criteria for choosing layouts in xml

I’m new to xml layout. I am confused which layout to choose, LinearLayout, RelativeLayout or ConstraintLayout, or others. In what scenarios should I use each?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

  • Linear layout – when you need to group few elements horizontally or vertically. Typically used as a nested layout of the relative layout.
  • Relative layout – when you need to layout multiple nested layout groups, you can align items center, left, top, etc. Typically used as root view layout in the past.
  • Constraint layout – this layout allow to group flat hierarchy of elements, with constraints you can combine the power of linear and relative layout and your layout will be much readable.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading