Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] ListView: Modify the animation/rebound behaviour of snap mode
Forum Updated to NodeBB v4.3 + New Features

[Solved] ListView: Modify the animation/rebound behaviour of snap mode

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • benlauB Offline
    benlauB Offline
    benlau
    Qt Champions 2016
    wrote on last edited by
    #1

    Hi all,

    I would like to create a component which will display one item at a time. User may do a swipe gesture to scroll to next item. However, I don't like the default easing curve used in the snap animation of ListView. I prefer a linear curve which will not rebound / or just rebound slightly. Any method to modify this behaviour?

    I have tried to set the rebound transition but it don't work. Thanks for any advise.

    The code:

    @
    import QtQuick 2.0

    ListView {
    orientation: ListView.Horizontal
    snapMode: ListView.SnapOneItem
    highlightRangeMode: ListView.StrictlyEnforceRange
    rebound: Transition {
    NumberAnimation {
    properties: "x,y"
    duration: 1000
    easing.type: Easing.Linear
    }
    }
    }
    @

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TioRoy
      wrote on last edited by
      #2

      Try
      @
      boundsBehavior: Flickable.StopAtBounds
      @

      1 Reply Last reply
      0
      • benlauB Offline
        benlauB Offline
        benlau
        Qt Champions 2016
        wrote on last edited by
        #3

        It works! Thank you!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved