gpt4 book ai didi

android-layout - 了解constraintBottom 和constraintBaseline

转载 作者:行者123 更新时间:2023-12-03 17:55:30 28 4
gpt4 key购买 nike

在 Android Studio 2.2 中可用的所有 ConstraintLayout 属性中,有这两个底部约束和一个基线约束:
layout_constraintBottom_toTopOflayout_constraintBottom_toBottomOflayout_constraintBaseline_toBaselineOf
似乎并不是每个 View 都有基线。

底部和基线约束之间有什么区别和相似之处?为什么只有某些 View 有基线?

official documentation缺乏这种信息。

编辑
此图像有助于了解基线与基础:
Baseline is the text's base inside a view. It is between the top and the bottom.
Text and bottom-with-text baseline

最佳答案

基线用于使 View 从底部到底部的文本

例如在 EditText 中,文本不是底部所以
如果您使用基线,它将位于底部

EditText的正文 不是 EditText 的 查看

enter image description here

更多信息来自 android developer training official website

关于android-layout - 了解constraintBottom 和constraintBaseline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39802390/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com