1. Introduction:
Linear layout Manager uses linear management of the controls or layouts in which they reside
Common Properties of 2.LinearLayout
Android:orientation = "vertical"--this property determines how the sub-class control is arranged (vertical: vertical; horizontal: Horizontal)
android:gravity = "center"--this property determines the position of the XY of its child control
Common property values
Center_vertical: Vertical (Y axis) centered
Center_horizontal: Horizontal (x axis) centered
Center: Vertical horizontal is centered
Right/left/buttom: Child controls are in the right/left/bottom of the current layout
Android:layout_gravity----The position of the current control itself and the parent control
Android:gravity---The position of the child control of the current control in the parent control
! Layout is a layout that can be applied
Gravity property: Determines the XY position of its subclasses
Gravity attributes can be used with multiple, separated by |
3. Usage
<span style= "font-family:kaiti_gb2312;" ><linearlayout xmlns:android= "http://schemas.android.com/apk/res/android" android:orientation= " Vertical "android:layout_width=" match_parent " android:layout_height=" match_parent "> <button Android:layout_width= "Match_parent" android:layout_height= "wrap_content" android:text= "first button" android:id= "@+id/button_first"/> <button android:layout_width= "Match_parent" android: layout_height= "Wrap_content" android:text= "second button" android:id= "@+id/button2" android: layout_gravity= "Center_horizontal"/> <textview android:layout_width= "Match_parent" android:layout_height= "Wrap_content" android:text= "implement jump page function" android:id= "@+id/textview" Android : layout_gravity= "Center_horizontal"/></linearlayout></span>
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android self-paced notebook Android five layout of the linear layout of the function, common properties, usage