# 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.