android学习(布局)

android学习(布局)

1.线性布局(LinearLayout

常用属性:
android:id (相当于地址的作用)
android:layout_width    
 (android:lauyout_width="match_patent"为其父空间)
android:layout_height
android:background
android:layout_margin(外边距)
   android:layout_marignTop(距离外上边距)
   android:layout_marignBottom(距离外部底部边距)
   android:layout_marignRight
   android:layout_marignLeft
android:layout_padding(内边距)
   android:paddingLeft
   android:paddingRight
   android:PaddingTop
   android:paddingBottom
android:orientation(有些特有才会有)
(线性:vertical(垂直) horizontal(水平))
android:gravity(给这线性布局设置属性:布局的对齐方式 )
(center中心,right右......)
android:layout_weight="1"(权重占比)

2.相对布局(RelativeLayout)
常用属性:
android:layout_toLeftof(相对于某物的左侧)
android:layout_toRightof
android:aligBottom(相对于某物的底部)
android:layout_alignParentBottom(相对于父页面的下部)
abdroid:layout_below(某物的下边)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值