Android Layout xml 中的几个概念

Android 文章第一抄,下面的这些东西是转自Android Developer Help上面的。他们上面说的很详细。我这里就转载一下,特别提醒下自己。

 

Android Layout Attributes 的一些不容易理解的地方。

android:padding

Padding is defined as space between the edges of the view and the view's content. A views size will include it's padding. If a background is provided, the padding will initially be set to that (0 if the drawable does not have padding). Explicitly setting a padding value will override the corresponding padding found in the background.

Must be a dimension value, which is a floating point number appended with a unit such as "14.5sp ". Available units are: px (pixels), dp (density-independent pixels), sp (scaled pixels based on preferred font size), in (inches), mm (millimeters).

 

控件内部控件边缘和内容的空白区

 

android:layout_margin

Specifies extra space on the left, top, right ,and bottom sides of this view. [dimension]

 

控件外部边缘和其他兄弟控件的空白区域,否则大部分情况下,会是直接相连的。

 

 

android:layout_alignLeft

Specifies extra space on the left side of this view. [dimension]

就是向着某个控件的左边对齐


android:layout_alignParentRight

If true, makes the left edge of this view match the left edge of the parent. [boolean]

就是向着父控的右边对齐

 


这些东西是用在布局文件里面,可以说他们提供的还是很全的参数。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值