I have a QML page that with a GridLayout that contains the page title, ListView and close button:
(我有一个QML页面,其中的GridLayout包含页面标题,ListView和关闭按钮:)
GridLayout {
columns: 1
rows: 5
anchors.fill: parent
<page title item>....
ListView
{
spacing: 15
model: logModel
delegate: Item {
implicitWidth: parent.width
implicitHeight: grid.height
RowLayout
{
id: grid
spacing: 0
width: parent.width
height: commentLabel.implicitHeight
<icon>....
Label {
id: commentLabel
Layout.fillWidth: true
text: comment
wrapMode: Label.Wrap
}
}
}
ScrollIndicator.vertical: ScrollIndicator { }
}
<close button>...
}
When I scroll the list, the first and the last visible item in the list may go beyond the list bounder and intersect the page title or close button:
(当我滚动列表时,列表中的第一个和最后一个可见项可能会超出列表边界,并与页面标题或关闭按钮相交:)
How to prevent this and make the items clipped?
(如何防止这种情况并使物品被修剪?)
ask by Dmitriano translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…