android 控件定位属性解析

android:layout_alignTop(Bottom/Left/Right)="@id/xxx"            将控件的上(下/左/右)边缘与给定控件的对齐

android:layout_alignParentTop(Bottom/Left/Right)="true"          如果设置为true, 将控件的上(下/左/右)边缘与父控件对齐

android:layout_marginTop(Bottom/Left/Right)="10dip"              将控件上的内容与控件的上(下/左/右)边缘相隔10dip

 

android:layout_above="@id/xxx"                                  --将控件置于给定ID控件之上
android:layout_below="@id/xxx"                                  --将控件置于给定ID控件之下

android:layout_toLeftOf="@id/xxx"                              --将控件的右边缘和给定ID控件的左边缘对齐
android:layout_toRightOf="@id/xxx"                            --将控件的左边缘和给定ID控件的右边缘对齐

android:layout_centerInParent="true"                          --将控件置于父控件的中心位置
android:layout_centerHorizontal="true"                        --将控件置于水平方向的中心位置
android:layout_centerVertical="true"                            --将控件置于垂直方向的中心位置

android:cacheColorHint="#00000000"                          --设置为这个值时是控件在拖动时显示当前控件设置的背景色,不会出现默认的黑色。

 

posted on 2013-01-29 18:05  Feel  阅读(255)  评论(0)    收藏  举报

导航