android布局格式(Android layout format)
android布局格式(Android layout format)
2, linear layout (Linear Layout)
If you are in the "android:orientation= horizontal" is set to vertical, is vertical or is vertical
(horizontal level) layout
Android:layout_width= "fill_parent"
Android:layout_height= "fill_parent"
Android:orientation= "horizontal" > on!
Android:layout_width= "wrap_content"
Android:layout_height= "wrap_content"
Android:text= Hello, I am a Button1 ""
Android:layout_weight= "1"
>
3, the relative layout (Relative Layout)
The relative layout is a ViewGroup to display the relative position of its subviews (view) elements, a view can be specified with respect to the position of its sibling views (for example in a given view left or below) a specific area or relative to the RelativeLayout position (for example, bottom alignment, or centre left).
The relative layout is a powerful tool for the design of user interface, because it eliminates the nested view group. If you find the LinearLayout view group you use multiple nested, you can consider using a RelativeLayout view group. Look at the following res/layour/main.xml:
XML version= "1" encoding= "UTF-8" >?
Android:layout_width= "fill_parent"
Android:layout_height= "fill_parent" >
Android:id= "@+id/label"
Android:layout_width= "fill_parent"
Android:layout_height= "wrap_content"
"Android:text= Type here:"
Android:id= "@+id/entry"
Android:layout_width= "fill_parent"
Android:layout_height= "wrap_content"
Android:background= "@android:drawable/editbox_background"
Android:layout_below= "@id/label" have an eye />!
Android:id= "@+id/ok"
Android:layout_width= "wrap_content"
Android:layout_height= "wrap_content"
Android:layout_below= "@id/entry" have an eye on - !
Android:layout_alignParentRight= "true" have an eye on - !
Android:layout_marginLeft= "10dip"