ConstraintLayout约束布局的应用

首先需要引入我们的ConstraintLayout,在build.gradle中加入:

compile 'com.android.support.constraint:constraint-layout:1.0.2'

ConstraintLayout 布局属性

ConstraintLayout 中的 Constraint 为名词(翻译为:约束;限制;强制),所以顾名思义该布局在每个在子 View 上添加各种约束条件来控制每个子 View 所处的位置以及显示的尺寸。ConstraintLayout 在 1.0 版本有如下 54 个布局属性:

  1. android_maxHeight

  2. android_maxWidth

  3. android_minHeight

  4. android_minWidth

  5. android_orientation

  6. layout_constraintBaseline_creator

  7. layout_constraintBaseline_toBaselineOf

  8. layout_constraintBottom_creator

  9. layout_constraintBottom_toBottomOf

  10. layout_constraintBottom_toTopOf

  11. layout_constraintDimensionRatio

  12. layout_constraintEnd_toEndOf

  13. layout_constraintEnd

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值