What is the difference between linear and relative layout?

后端 未结 10 1737
無奈伤痛
無奈伤痛 2020-12-30 13:48

What is the difference between linear and relative layout?

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-30 14:23

    Linear Layouts

    1. Linear Layouts are great for aligning views in rows and columns.
    2. They are a good way to divide up one place using layout weights that will expand or shrink views depending on the size of the Display.

    Relative Layouts

    1. Relative Layouts are great for positioning elements relative to one another.
    2. For example putting B below A or putting C in the lower left hand corner.Check the Screen shoot
    3. Relative layout also make it easy to overlap views. For Example : view A is overlapping view B. Check the Screen-Shoot

提交回复
热议问题