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

ScrollView Position Animation



  • hi, i am using scrollview on mobile, i adjust its position manually. How can I apply an animation for a smoother transition?

    ScrollView {
        id: pageScroll
        anchors.fill: parent
        contentWidth: parent.width
        height: parent.height
    
        ScrollBar.vertical: ScrollBar {
    
            policy: ScrollBar.AlwaysOff
            interactive: false
            clip: true
    
            onPositionChanged: {
                if(position <= -0.07) {
                    position = 0
                }
    
                if(position >= 0.4) {
                    position = 0.3
                }
            }
        }
    }
    

Log in to reply