有些定义让我感到困惑...我发现文本的 anchors.baseline 与矩形的不同.. 为什么?基线的定义是什么?谢谢...
Item {
width: 400; height: 200
Rectangle {
y:20
id: rectangle
width: 80; height: 80
color: "red"
}
Text {
text: "Hello World!"
anchors.baseline: rectangle.baseline
anchors.left: rectangle.right
}
}
Rectangle 的基线在上,Text 的基线在下?
最佳答案
基线对应于文本所在的假想线。对于没有文本的项目,它与顶部相同。
关于c++ - QML 中的 anchors.baseline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9440534/