Today, I learned the relativelayout example on the official website. However, due to my limited level of English, I have seen a good Chinese version on the Internet to explain the usage of relativelayout attributes.
Go to http://blog.sina.com.cn/s/blog_55b1b0d50100n3d9.html. Thank you!
Android relativelayout attributes
// Relative to the given ID Control
Android: layout_above: place the bottom of the control on the control with the given ID;
Android: layout_below: place the bottom of the control under the control with the given ID;
Android: layout_toleftof align the right edge of the control with the left edge of the control with the given ID;
Android: layout_torightof align the left edge of the control with the right edge of the control with the given ID;
Android: layout_alignbaseline: Align the baseline of the control with the baseline of the given ID;
Android: layout_aligntop: Align the top edge of the control with the top edge of the given ID;
Android: layout_alignbottom: Align the bottom edge of the control with the bottom edge of the given ID;
Android: layout_alignleft: Align the left edge of the control with the left edge of the given ID;
Android: layout_alignright: Align the right edge of the control with the right edge of the given ID;
// Relative to the parent component
Android: layout_alignparenttop if it is true, align the top of the control with the top of its parent control;
Android: layout_alignparentbottom: If this parameter is set to true, the bottom of the control is aligned with the bottom of its parent control;
Android: layout_alignparentleft: if it is true, align the left of the control with the left of its parent control;
Android: layout_alignparentright: if it is set to true, align the right of the control with the right of its parent control;
// Center
Android: layout_centerhorizontal if true, place the control horizontally in the center;
Android: layout_centervertical if true, place the control vertically in the center;
Android: layout_centerinparent if true, place the control in the center of the parent control;
// Specify the moving Pixel
Android: layout_margintop offset value;
Android: layout_marginbottom offset value;
Android: layout_marginleft value of the left offset;
Android: value of the right offset of layout_marginright;
Example:
Android: layout_below = "@ ID /***"
Android: layout_alignbaseline = "@ ID /***"
Android: layout_alignparenttop = true
Android: layout_marginleft = "10px"