1, relative to an element, the use of "@id/***"
Android:layout_toleftof on the left side of an element
Android:layout_torightof on the right side of an element
The android:layout_below is below an element.
Android:layout_above on top of an element
2, relative to an element, the use of "@id/***"
Android:layout_aligntop aligns the upper end of the current element with the upper end of an element
Android:layout_alignleft the left of the current element aligns with the left of an element
Android:layout_alignright aligns the right end of the current element with the right end of an element
Android:layout_alignbottom The lower end of the current element aligns with the lower end of an element
3, use to set specific values, such as 30DP
Android:layout_marginleft external distance left distance
Android:layout_margintop distance from the top of the outer distance
Android:layout_marginright External distance Right distance
Android:layout_marginbottom external distance from bottom edge
Android:layout_margin If the direct margin is the outside distance around the distance
4, use to set specific values, such as 30DP
Distance from top of android:paddingtop interior
Android:paddingleft interior distance left distance
Android:paddingright Interior distance Right distance
Android:paddingbottom internal distance from bottom
android:padding internal distance from the surrounding distance
5.
android:gravity="left" text
The difference between android:gravity and android:layout_gravity
The Android:gravity property is the qualification for the content in the view. For example, a button above the text. You can set the text relative to the view's left, right, and so on.
Android:layout_gravity is used to set the location of the view relative to the parent view. For example, a button in the LinearLayout, you want to put the button in the LinearLayout left, on the right and so on can be set by this property.
6.
7.
8.
Android Beginner's layout properties