System login interface development and implementation (5) interface copyright component settings, copyright component
Development steps:
- Open activity_login.xml in layout under res.
- Add a TextView component object and set its attributes
Android: layout_width attribute
- Purpose: set the component width.
Android: layout_height attribute
- Purpose: set the height of the component.
- Constant parameter: warp_content text adaptive, fill_parent container adaptive
Android: gravity attributes
- Purpose: Set alignment
- Constant parameter: horizontal alignment of center_horizontal
Android: layout_marginBottom attributes
- Purpose: set the distance from the bottom.
Android: layout_alignParentBottom attributes
- Purpose: Set it to align at the bottom of the parent container.
Code:
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Copyright@2015 Socrates Reserved." android:gravity="center_horizontal" android:textSize="12sp" android:textColor="#000000" android:layout_marginBottom="10dp" android:layout_alignParentBottom="true"/>
Run:
Summary:Android: layout_alignParentBottom attributes must be relatively laid out in the parent container!