android的布局格式,android布局格式(Android layout format).doc

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"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值