LinearLayout is a linear layout control: It is either laterally arranged or vertically arranged
Decisive attribute: Must have!
Android:orientation:vertical (vertical direction), horizontal (horizontal)
Common Properties:
Android:gravity------------Set the content location above the control itself
Android:layout_gravity-----Sets the display position of the control itself relative to the parent control
Android:layout_weight-----Assigning remaining space to a control
Example of vertical arrangement:
<span style= "Font-family:comic Sans ms;font-size:18px;" ><?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/ Res/android " android:layout_width=" match_parent " android:layout_height=" match_parent " android:o rientation= "vertical" ><button android:layout_width= "match_parent" android:layout_height= "Wrap_ Content " android:text=" button 1 " /><button android:layout_width=" match_parent " android:layout _height= "Wrap_content" android:text= "button 2" /><button android:layout_width= "Match_parent" android:layout_height= "wrap_content" android:text= "button 3" /><button Android:layout_ Width= "Match_parent" android:layout_height= "wrap_content" android:text= "button 4" /></ Linearlayout></span>
Example of horizontal arrangement:
<span style= "Font-family:comic Sans ms;font-size:18px;" ><?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/ Res/android " android:layout_width=" match_parent " android:layout_height=" match_parent " android:o rientation= "Horizontal" ><button android:layout_width= "wrap_content" android:layout_height= "Wrap_ Content " android:text=" button 1 " /><button android:layout_width=" wrap_content " android:layout _height= "Wrap_content" android:text= "button 2" /><button android:layout_width= "Wrap_content" android:layout_height= "wrap_content" android:text= "button 3" /><button Android:layout_ Width= "Wrap_content" android:layout_height= "wrap_content" android:text= "button 4" /></ Linearlayout></span>
Nested linear layouts:
<span style= "Font-family:comic Sans ms;font-size:18px;" ><?xml version= "1.0" encoding= "Utf-8"? ><linearlayout xmlns:android= "http://schemas.android.com/apk/ Res/android " android:layout_width=" match_parent " android:layout_height=" match_parent " android:o rientation= "Horizontal" > <linearlayout > ... </LinearLayout> <LinearLayout> .. </LinearLayout> </LinearLayout></span>
Android "layout Manager"--Linear layout linearlayout