Android ConstraintLayout 属性列表以及使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013148839/article/details/78600129

大自然的搬运工
参考: http://www.jianshu.com/p/c60f787817ad
https://juejin.im/post/5a1d9ba66fb9a044fb07819e

  1. app:layout_constraintLeft_toLeftOf 表示此控件的左边框与某个控件的左边框对齐或者在其右边
  2. app:layout_constraintLeft_toRightOf 表示此控件的左边框与某个控件的右边框对齐或者在其右边
  3. app:layout_constraintRight_toLeftOf 表示此控件的右边框与某个控件的左边框对齐或在其左边
  4. app:layout_constraintRight_toRightOf 表示此控件的右边框与某个控件的右边框对齐或在其左边
  5. app:layout_constraintTop_toTopOf 表示此控件的顶部边框与某个控件的顶部边框水平对齐或在其下边
  6. app:layout_constraintTop_toBottomOf 表示此控件的顶部边框与某个控件的底部边框水平对齐或在其下边
  7. app:layout_constraintBottom_toTopOf 表示此控件的底部边框与某个控件的顶部边框水平对齐或其上边
  8. app:layout_constraintBottom_toBottomOf 表示此控件的底部边框与某个控件的底部边框水平对齐或其上边
  9. app:layout_constraintBaseline_toBaselineOf 表示此控件与某个控件水平对齐
  10. app:layout_editor_absoluteX 表示此控件在布局中X轴的绝对坐标点
  11. app:layout_editor_absoluteY 表示此控件在布局中Y轴的绝对坐标点
  12. app:layout_constraintGuide_begin 表示在布局中引导线距顶部或左边框的距离
  13. app:layout_constraintGuide_end 表示在布局中引导线距底部的距离
  14. app:layout_constraintGuide_percent 表示在整个布局中引导线距离左边框的百分百
  15. app:layout_constraintStart_toEndOf 表示此控件的左边界在某个控件右边界的右边,及表示此控件在某个控件的右边
  16. app:layout_constraintStart_toStartOf 表示此控件的左边界与某个控件的左边界在同一垂直线上
  17. app:layout_constraintEnd_toStartOf 表示此控件的右边界与某个控件的左边界在同一垂直线上
  18. app:layout_constraintEnd_toEndOf 表示此控件的右边界与某个控件的右边界对齐
  19. app:layout_constraintHorizontal_bias 表示此控件在布局中的水平方向上的偏移百分百
  20. app:layout_constraintVertical_bias 表示此控件在布局中的的垂直方向上的偏移百分百
  21. app:layout_constraintDimensionRatio 表示两个控件的纵横比,而使用则需要把宽(layout_width)或者高(layout_height)设置为0dp,根据另一个属性和比例, 计算当前属性, 如两个图片控件的显示大小,app:layout_constraintDimensionRatio=”4:3”;
  22. app:layout_goneMarginLeft
  23. app:layout_goneMarginTop
  24. app:layout_goneMarginRight
  25. app:layout_goneMarginBottom
  26. app:layout_goneMarginStart
  27. app:layout_goneMarginEnd

猜你喜欢

转载自blog.csdn.net/u013148839/article/details/78600129