Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Swipe View showing more than one page



  • Hi, I'm trying to create SwipeView that doesn't fill whole windown and when I create it inside Rectangle that isn't size of the window, previous and next site is also visible and I have no idea why it's happening.

    4ced7347-6a0d-45aa-96f8-18bc673d1202-image.png

    import QtQuick 2.14
    import QtQuick.Window 2.14
    import QtQuick.Controls 2.14
    
    Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        Rectangle{
            id: rectId
            anchors.centerIn: parent
            width: 200
            height: 480
    
    
    
            SwipeView {
                    id: view
                    anchors.fill: parent
                    currentIndex: 1
    
                    Component.onCompleted: forceActiveFocus()
                    Rectangle {
                        color: "red"
                        width: 200
                        height: 400
                    }
                    Rectangle {
                        color: "green"
                        width: 200
                        height: 400
                    }
                    Rectangle {
                        color: "blue"
                        width: 200
                        height: 400
                    }
                }
    
            PageIndicator {
                id: indicator
    
                count: view.count
                currentIndex: view.currentIndex
    
                anchors.bottom: view.bottom
                anchors.horizontalCenter: parent.horizontalCenter
            }
        }
    
    }
    


  • I've found solutionlink text

    15c1aef5-8a4f-4c7b-848e-6d0d4d98a9fb-image.png



  • I've found solutionlink text

    15c1aef5-8a4f-4c7b-848e-6d0d4d98a9fb-image.png


Log in to reply