LinearLayout
2018-07-06 23:31:08 5 举报
AI智能生成
Android的线性布局表
作者其他创作
大纲/内容
<font color="#5c5c5c" style=""><b>1、常用属性</b></font>
<h3><font color="#000000" style=""><b>orintation:</b></font></h3>
<b style=""><font color="#662c90">布局中组件的排序方式,有horizontal(水平),certcal(竖直,默认),两种方式</font></b>
<h3><b><font color="#000000">gravity:</font></b></h3>
<b><font color="#662c90">控制组件所包含的子元素的对齐方式,可多个组合,如(left|buttom)</font></b><br>
<h3><b><font color="#000000">layout_gravity:</font></b></h3>
<b><font color="#662c90">控制该组件在父容器里的对齐方式</font></b>
<h3><b><font color="#000000">layout_width:</font></b></h3>
<b><font color="#662c90">布局的宽度,通常不直接写数字的,用wrap_contrnt(组件实际大小),match_parent填满父容器</font></b>
<h3><b><font color="#000000">layout_height:</font></b></h3>
<b><font color="#662c90">布局的高度,通常不直接写数字的,用wrap_contrnt(组件实际大小),match_parent填满父容器</font></b>
<h3><b><font color="#000000">id:</font></b></h3>
<b><font color="#662c90">为该组件设置一个资源id,在Java文件中可以通过 f indViewById(id)找到该组件</font></b>
<h3><b><font color="#000000">background:</font></b></h3>
<b><font color="#662c90">为该组件设置一个背景图片,或者直接用颜色覆盖</font></b>
<b><font color="#5c5c5c">2、Weight(权重)</font></b><br>
<b><font color="#924517">该属性是用来比例地分区域</font></b>
<b><font color="#924517">1、最简单的用法:要等比例划分,分谁,谁为0,weight按比例即可</font></b>
<font color="#924517" style=""><b>2、Weight使用详解</b></font>
<b><font color="#5c5c5c">3、divider分割线:</font></b>
<b><font color="#924517">该属性用于为LinearLayout设置分割线图片,通过showDividers来设置分割线的所在位置,有四个可选值nine,middle,begining,end,当然你还可以通过</font></b>
<h3><font color="#000000">divider</font></h3>
<b><font color="#924517">为LinearLayout设置分割线的图片</font></b>
<h3><b><font color="#000000">showDividers</font></b></h3>
<b><font color="#924517">设置分割线所在的位置,有四个可选值:none,middle,begining,end</font></b>
<h3><b><font color="#000000">dividerPadding</font></b></h3>
<b><font color="#924517">设置分割线的padding</font></b>
收藏
0 条评论
下一页