Linear layouts, where controls are arranged in a straight line, either horizontally or vertically.
Right-click on the Layout folder and choose New Android XML file, select resource type Select Layout----root node Select Linearlyout
<?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:orientation= "vertical" > <textview android:layout_width= " Match_parent " android:layout_height=" Wrap_content " android:background= "#FF0000" android:text= "First TextView" /> <TextView android:layout_width= "Wrap_content" android:layout_height= "Wrap_content" android:background= " #00FF00 " &nbsP; android:text= "A second TextView" ></TextView></LinearLayout>
Android:orientation sets the direction (vertical (vertical) and horizontal (horizontal)), and if the layout direction is set horizontally, the width of the control is not set to relative to the parent control, otherwise the control is extruded out of the screen.
Effect:
Android Layout----LinearLayout Layout method