我正在尝试在 a 中添加一些东西ScrollView
以width
适应屏幕。ScrollView
锚定到主窗口。
例如,一个Rectangle
:
ScrollView {
anchors.fill: parent //mainWindow
Rectangle {
color: "light grey"
height: 1000
width: mainWindow.width
}
}
但是当垂直滚动条出现时,它会遮挡Rectangle
. 我可以通过使用魔法常数来修复它:
width: mainWindow.width - 20
但是如果有人在他们的计算机上有更大的滚动条呢?当垂直滚动条不可见时,它也会在右侧留下一个难看的空白空间。
有没有办法自动了解 a 内部的可用空间是什么ScrollView
?