您的位置: 首页 > 文章 > Android的UI布局 Android的UI布局 分类: 文章 • 2023-02-03 00:09:10 目录 线性布局: 相对布局 安卓的UI层次体系: 线性布局LinearLayout 方向 android::orientation (vertical/horizotal) 重力 gravity (bottom|right, center……) 权重 weight (设置在控件上面,相应方向的宽、高设置为0) getChildAt(int index)得到相应索引的子控件 getChildCount()得到子控件的个数 相对布局RelativeLayout 相对于容器 相对于控件 布局共有属性 padding:内容和边框之间的距离 margin:两个控件之间的间距