是否可以从卷帘视图中删除动画?你可以看到上一页和下一页的过渡。我有许多页面,并且我有一个菜单可以选择活动项目,如下所示:
mainContent.setCurrentIndex(0)其中mainContent是卷帘视图。
// The content changes based on what is clicked on in the menu
SwipeView{
width: mainWindow.width - mainMenuId.width -anchors.leftMargin
id:mainContent
anchors.leftMargin: 20
anchors.topMargin: 20
clip:true
Component.onCompleted: contentItem.interactive = false
currentIndex: 0
Item{PageMain{}}
Item{PageTests{}}
Item{PageData{}}
Item{PageSavedFiles{}}
Item{PageProbe{}}
}发布于 2019-07-16 21:15:23
你可以覆盖contentItem和disable列表视图的动画,或者,如果你真的不需要SwipeView的卷帘部分,可以使用例如StackLayout:
TabBar {
id: bar
width: parent.width
TabButton {
text: qsTr("Home")
}
TabButton {
text: qsTr("Discover")
}
TabButton {
text: qsTr("Activity")
}
}
StackLayout {
width: parent.width
currentIndex: bar.currentIndex
Item {
id: homeTab
}
Item {
id: discoverTab
}
Item {
id: activityTab
}
}这段代码使用的是TabBar,但我想您应该明白了。:)
https://stackoverflow.com/questions/57056467
复制相似问题