首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >SwipeView不会垂直滚动

SwipeView不会垂直滚动
EN

Stack Overflow用户
提问于 2017-09-27 20:18:21
回答 1查看 1.1K关注 0票数 1

我与this one有相同的问题,但在Qt和QML方面。

我想要能够水平滑动,但也可以垂直滚动在某些页面上的滚动条,以便用户可以提交一个表单。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-09-28 09:31:57

FlickableScrollBar一起使用

代码语言:javascript
复制
import QtQuick 2.9
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3

ApplicationWindow {
    id: window
    width: 400
    height: 300
    visible: true

    SwipeView {
        anchors.fill: parent

        Rectangle {
            Text {
                text: "Page 1"
                anchors.centerIn: parent
            }
        }

        Flickable {
            id: listView
            contentWidth: width
            contentHeight: pane.implicitHeight

            ScrollBar.vertical: ScrollBar {}

            Pane {
                id: pane

                GridLayout {
                    columnSpacing: 10
                    columns: 2
                    anchors.fill: parent

                    Label { text: "Label" }
                    Button { text: "Button" }

                    Label { text: "Label" }
                    RadioButton { text: "RadioButton" }

                    Label { text: "Label" }
                    ComboBox { model: 100 }

                    Label { text: "Label" }
                    Button { text: "Button" }

                    Label { text: "Label" }
                    RadioButton { text: "RadioButton" }

                    Label { text: "Label" }
                    ComboBox { model: 100 }

                    Label { text: "Label" }
                    Button { text: "Button" }

                    Label { text: "Label" }
                    RadioButton { text: "RadioButton" }

                    Label { text: "Label" }
                    ComboBox { model: 100 }
                }
            }
        }

        Rectangle {
            visible: SwipeView.isCurrentItem

            Text {
                text: "Page 3"
                anchors.centerIn: parent
            }
        }
    }
}
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46456541

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档