在 Android Studio 2.2 中可用的所有 ConstraintLayout 属性中,有以下两个Bottom约束和一个Baseline约束:
layout_constraintBottom_toTopOf
layout_constraintBottom_toBottomOf
layout_constraintBaseline_toBaselineOf
而且似乎并非每个视图都有基线。
底部约束和基线约束有什么区别和相似之处?为什么只有某些视图有基线?
在 Android Studio 2.2 中可用的所有 ConstraintLayout 属性中,有以下两个Bottom约束和一个Baseline约束:
layout_constraintBottom_toTopOf
layout_constraintBottom_toBottomOf
layout_constraintBaseline_toBaselineOf
而且似乎并非每个视图都有基线。
底部约束和基线约束有什么区别和相似之处?为什么只有某些视图有基线?
基线用于使视图从底部到文本底部
例如在 EditText 中,文本不是底部,因此如果您使用基线,它将位于底部
EditText 的文本不是 EditText 的视图
更多信息来自安卓开发者培训官方网站