Gravity and layout gravity

来源:互联网 发布:微距摄影师500px知乎 编辑:程序博客网 时间:2024/06/05 19:45

# Gravity and layout gravity #

android:layout_gravity

  • android:layout_gravity is used to set the position of an element in its parent (e.g. a child View inside a Layout).
  • Supported by LinearLayout and FrameLayout

android:gravity

  • android:gravity is used to set the position of content inside an element (e.g. a text inside a TextView).

Remarks

LayoutParams and Layout_ Attributes

a RelativeLayout requires two layout passes to render properly. For complex view hierarchies, this can have a significant impact on performance. Nesting RelativeLayouts makes this problem even worse, because every RelativeLayout causes the number of layout passes to go up.

0 0