读书人

Android UI 根本布局 weight 在 Lin

发布时间: 2012-09-06 10:37:01 作者: rapoo

Android UI 基本布局 weight 在 LinearLayout 中

?? 注释:? 1 个 LinearLayout 包含? 3个LinearLayout??

???????? 第一个: height? wrap_content? 自适应? width??? fill_parent? 充满容器

? ? ? ?? 第二个和第三个? weight? 总和为? 3 ? 那么 除掉第一个自适应的LinearLayout? ? 余下的LinearLayout? 就平分剩下的空间 第二个 占 余下的 2/3 ? 第三个占 余下的 1/3 ?

?

?

?

?

padding margin? 区别

?

?

<RelativeLayout
??? ??? ??? android:id="@+id/RelativeLayout02"
??? ??? ??? android:background="@drawable/login_back"
??? ??? ??? android:paddingTop="21.0px"
??? ??? ??? android:paddingBottom="10.0px"
??? ??? ??? android:layout_width="fill_parent"
??? ??? ??? android:layout_height="wrap_content"
??? ??? ??? android:layout_marginLeft="15.0px"
??? ??? ??? android:layout_marginTop="62.0px"

??? ??? ??? android:layout_marginRight="15.0px">

?

?

?



Android UI  根本布局  weight 在 LinearLayout  中

?

?

?


Android UI  根本布局  weight 在 LinearLayout  中

?

?

?

?

<supports-screens android:largeScreens="true"

android:anyDensity="true" android:resizeable="true" /> 全屏

?

?

android:layout_above 将该控件的底部至于给定ID的控件之上
??? ??? android:layout_below 将该控件的顶部至于给定ID的控件之下
??? ??? android:layout_toLeftOf 将该控件的右边缘和给定ID的控件的左边缘对齐
??? ??? android:layout_toRightOf 将该控件的左边缘和给定ID的控件的右边缘对齐

??? ??? android:layout_alignBottom 将该控件的底部边缘与给定ID控件的底部边缘
??? ??? android:layout_alignLeft 将该控件的左边缘与给定ID控件的左边缘对齐
??? ??? android:layout_alignRight 将该控件的右边缘与给定ID控件的右边缘对齐
??? ??? android:layout_alignTop 将给定控件的顶部边缘与给定ID控件的顶部对齐

??????? android:layout_alignParentBottom 如果该值为true,则将该控件的底部和父控件的底部对齐
??? ??? android:layout_alignParentLeft 如果该值为true,则将该控件的左边与父控件的左边对齐
??? ??? android:layout_alignParentRight 如果该值为true,则将该控件的右边与父控件的右边对齐
??? ??? android:layout_alignParentTop 如果该值为true,则将空间的顶部与父控件的顶部对齐

??????? android:layout_centerHorizontal 如果值为真,该控件将被至于水平方向的中央
??? ??? android:layout_centerInParent 如果值为真,该控件将被至于父控件水平方向和垂直方向的中央
??? ??? android:layout_centerVertical 如果值为真,该控件将被至于垂直方向的中央

??????? android:layout_marginTop 该控件上部外侧与其他控件的距离
????? ? android:layout_marginBottom 该控件下部外侧与其他控件的距离
??????? android:layout_marginLeft 该控件左侧与其他控件的距离
??????? android:layout_marginRight 该控件右侧与其他控件的距离
??????? android:layout_margin 该控件四周与其他控件的间距

??????? android:padding 控件内部四周填充距离
??????? android:paddingLeft 该控件左侧填充距离
??????? android:paddingRight 该控件右侧填充距离
??????? android:paddingBottom 该控件顶部填充距离
??????? android:paddingTop 该控件底部填充距离

?

?

http://blog.csdn.net/xjanker2/archive/2011/03/04/6222690.aspx? 自定义button

Android UI  根本布局  weight 在 LinearLayout  中

读书人网 >Android

热点推荐