ConstraintLayout 布局属性详解

app:layout_constraintLeft_toLeftOf

表示此控件的左边框与某个控件的左边框对齐或者在其右边

app:layout_constraintLeft_toRightOf

表示此控件的左边框与某个控件的右边框对齐或者在其右边

app:layout_constraintRight_toLeftOf

表示此控件的右边框与某个控件的左边框对齐或在其左边

app:layout_constraintRight_toRightOf

表示此控件的右边框与某个控件的右边框对齐或在其左边

app:layout_constraintTop_toTopOf

表示此控件的顶部边框与某个控件的顶部边框水平对齐或在其下边

app:layout_constraintTop_toBottomOf

表示此控件的顶部边框与某个控件的底部边框水平对齐或在其下边

app:layout_constraintBottom_toTopOf

表示此控件的底部边框与某个控件的顶部边框水平对齐或其上边

app:layout_constraintBottom_toBottomOf

表示此控件的底部边框与某个控件的底部边框水平对齐或其上边

app:layout_constraintBaseline_toBaselineOf

表示此控件与某个控件水平对齐

app:layout_editor_absoluteX

表示此控件在布局中X轴的绝对坐标点。

app:layout_editor_absoluteY

表示此控件在布局中Y轴的绝对坐标点

app:layout_constraintGuide_begin

表示在布局中引导线距顶部或左边框的距离(如:20dp表示距顶部或者左边框20dp)

app:layout_constraintGuide_end

表示在布局中引导线距底部的距离(如:10dp表示距顶部10dp)

app:layout_constraintGuide_percent

表示在整个布局中引导线距离左边框的百分百(如:app:layout_constraintGuide_percent=”0.5”表示距离左边框50%的位置)

app:layout_constraintStart_toEndOf

表示此控件的左边界在某个控件右边界的右边,及表示此控件在某个控件的右边

app:layout_constraintStart_toStartOf

表示此控件的左边界与某个控件的左边界在同一垂直线上

app:layout_constraintEnd_toStartOf

表示此控件的右边界与某个控件的左边界在同一垂直线上

app:layout_constraintEnd_toEndOf

表示此控件的右边界与某个控件的右边界对齐

app:layout_constraintHorizontal_bias

表示此控件在布局中的水平方向上的偏移百分百。

app:layout_constraintVertical_bias

表示此控件在布局中的的垂直方向上的偏移百分百。如视图16,代码16

app:layout_constraintDimensionRatio

表示两个控件的纵横比,而使用则需要把宽(layout_width)或者高(layout_height)设置为0dp,根据另一个属性和比例, 计算当前属性, 如两个图片控件的显示大小,app:layout_constraintDimensionRatio=”4:3”;

app:layout_goneMarginLeft
//The left margin to use when the target is gone.

app:layout_goneMarginTop
//The top margin to use when the target is gone.

app:layout_goneMarginRight
//The right margin to use when the target is gone

app:layout_goneMarginBottom
//The bottom margin to use when the target is gone.

app:layout_goneMarginStart
//The start margin to use when the target is gone.

app:layout_goneMarginEnd
//The end margin to use when the target is gone.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值