QtQuick 2.12中的垂直滑动

  • 本文关键字:垂直 QtQuick qt qml
  • 更新时间 :
  • 英文 :


我目前被迫使用QTQuick和Qt.Quick.Controls 2.12。我想找到一个解决方案来实现页面的垂直滑动。可以使用SwipeView吗?不幸的是,属性" vertical "已在较晚版本中实现。

SwipeView {
id: view
currentIndex: 0
anchors.fill: parent

Item {
id: mainPage
PageMain{}
}
Item {
id: secondPage
}
}
SwipeView {
id: view
currentIndex: 0
anchors.fill: parent
orientation: Qt.Vertical
Item {
id: mainPage
PageMain{}
}
Item {
id: secondPage
}
}

我添加了'orientation'属性,但是你必须导入QtQuick。2.15控制。