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] Scrollview on android device
Forum Update on Monday, May 27th 2025

[SOLVED] Scrollview on android device

Scheduled Pinned Locked Moved QML and Qt Quick
6 Posts 4 Posters 2.8k Views
  • 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.
  • M Offline
    M Offline
    morker
    wrote on 8 Dec 2014, 17:01 last edited by
    #1

    Hi there,

    is it possible to disable horizontal scrolling on a ScrollView? I got a different behavior on my mac and on the android device. On my android device if I touch and hold a element of the ScrollView I can draw or move the element in all directions and if I release it with my finger it jumps back its origin.

    How can I avoid this?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      p3c0
      Moderators
      wrote on 9 Dec 2014, 05:04 last edited by
      #2

      Hi,

      To disable horizontal scrolling on ScrollView, try this:
      @
      ScrollView {
      Image { source: "15686.jpg" }
      flickableItem.onContentXChanged: flickableItem.contentX = 0
      }
      @

      157

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jens
        wrote on 9 Dec 2014, 09:21 last edited by
        #3

        That workaround will probably cause problems. I would suggest that you instead try:
        @
        ScrollView {
        Image { source: "15686.jpg" }
        flickableItem.flickableDirection: Flickable.VerticalFlick
        }
        @

        1 Reply Last reply
        0
        • M Offline
          M Offline
          morker
          wrote on 9 Dec 2014, 10:23 last edited by
          #4

          Thanks, that solved my problem!

          1 Reply Last reply
          0
          • N Offline
            N Offline
            ningen
            wrote on 9 Dec 2014, 10:58 last edited by
            #5

            how to make the center item (anchors.centerIn: appWindow.center) was scrolling ?
            @import QtQuick 2.2
            import QtQuick.Controls 1.1
            import QtQuick.Window 2.0
            ApplicationWindow{
            id: appWindow
            visible: true
            width:Screen.width
            height:Screen.height
            ScrollView
            {
            anchors.fill: parent
            Rectangle
            {
            width: 800
            height: 800
            color : "yellow"
            anchors.centerIn: appWindow.center
            }
            }
            }@

            1 Reply Last reply
            0
            • P Offline
              P Offline
              p3c0
              Moderators
              wrote on 10 Dec 2014, 07:11 last edited by
              #6

              +1 Jens for the exact solution.

              157

              1 Reply Last reply
              0

              1/6

              8 Dec 2014, 17:01

              • Login

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