Android的UI布局
时间 2021-08-15
标签
Android
android
目录
线性布局:
相对布局
安卓的UI层次体系:
线性布局LinearLayout
-
方向 android::orientation (vertical/horizotal)
-
重力 gravity (bottom|right, center……)
-
权重 weight (设置在控件上面,相应方向的宽、高设置为0)
-
getChildAt(int index)得到相应索引的子控件
-
getChildCount()得到子控件的个数
相对布局RelativeLayout
布局共有属性
padding:内容和边框之间的距离
margin:两个控件之间的间距