RelativeLayout property

Relative to the sibling element
android:layout_below="@id/aaa": below the specified View
android:layout_above="@id/xxx": above the specified View
android:layout_toLeftOf="@id/bbb": in the specified View Left
android:layout_toRightOf="@id/cccc": on the right side of the specified View relative to sibling elements
android:layout_below="@id/aaa": below the specified View
android:layout_above="@id/xxx": in Above the specified View
android:layout_toLeftOf="@id/bbb": on the left side of the specified View
android:layout_toRightOf="@id/cccc": on the right side of the specified View


Relative to the parent element
android:layout_alignParentLeft="true": left inside the parent element
android:layout_alignParentRight="true": right inside the parent element
android:layout_alignParentTop="true": top inside the parent element
android:layout_alignParentBottom="true" : at the bottom of the parent element


Alignment
android:layout_centerInParent="true": center layout
android:layout_centerVertical="true": horizontal center layout
android:layout_centerHorizontal="true": vertical center layout
android:layout_alignTop="@id/xxx": with the specified View Consistent border
android:layout_alignBottom="@id/xxx": Consistent with the lower border of the specified View
android:layout_alignLeft="@id/xxx": Consistent with the left border of the specified View
android:layout_alignRight="@id/xxx": Consistent with the specified The right border of the View is consistent


Interval
android:layout_marginBottom=""; the distance from the bottom edge of an element
android:layout_marginLeft=""; the distance from the left edge of an element
android:layout_marginRight=""; the distance from the right edge of an element
android:layout_marginTop=""; The distance from the top edge of an element
android:layout_paddingBottom=""; the distance from the bottom edge of the parent element
android:layout_paddingLeft=""; the distance from the left edge of the parent element
android:layout_paddingRight=""; the distance from the right edge of the parent element
android :layout_paddingTop=""; The distance from the upper edge of the parent element. The

difference between margin and padding is that
padding is from the perspective of the parent view, and is the distance between its own content and the edge of its parent control. Margin describes the problem from its own perspective, the distance between itself and a component next to it. If there is only one view at the same level, then its effect is basically the same as padding.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325393105&siteId=291194637