ant*_*afe 5 qt delegates listview qml flickable
要为Qt制作类似Android ViewPager,我使用如下的列表视图:
ListView {
id: myListViewArticle
anchors.fill: parent
focus: true
highlightRangeMode: ListView.StrictlyEnforceRange
orientation: ListView.Horizontal
snapMode: ListView.SnapOneItem
model: modelArticles
delegate: articleDelegate
}
Run Code Online (Sandbox Code Playgroud)
和Flickable作为其代表:
Component {
id: articleDelegate
Item {
id: item
width: 480; height: 800
Flickable {
id: mainScrollView
contentHeight: 1500
contentWidth: parent.width
anchors.fill: parent
clip: true
Text {
id: idArticleContent
text: articleContent
width: parent.width
font.pixelSize: 20
font.bold: true; color: "black"
wrapMode: Text.Wrap
}
}
ScrollDecorator {
flickableItem: mainScrollView
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是在为listview填充数据之后,我看到Flickable无法滚动(在Verticle中).
谁能告诉我如何在列表视图中滚动Flickable项目.非常感谢你的帮助.
| 归档时间: |
|
| 查看次数: |
2646 次 |
| 最近记录: |