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. Centering ScrollView in the middle of the screen
Qt 6.11 is out! See what's new in the release blog

Centering ScrollView in the middle of the screen

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 70 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.
  • D Offline
    D Offline
    DSpUz
    wrote last edited by
    #1

    Hello fello Qt Devs,

    how does one center ScrollView in the middle of the screen?

    I have it as an element of page and tried achors.horizontalCenter: parent.horizontalCenter
    anchors.centerIn:
    x:
    made the text be inside of Column{} and set ScrollViews height to that columns height and even tried to center the Text{} elements of the ScrollView to center of page by its Id, but nothing works. It is either left-aligned or breaks.

    Should I remove the Page element since it might interfere,k but how then i put buttons that stay in the same location when one scrolls, and I also havent seen ScrollView centered even when its standalone, in tutorial version it was also left-aligned.

    Cheers, DSU

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote last edited by
      #2

      Keep in mind that when you try to center elements containing text, you also need to align the text itself inside the component (vertical and horizontal alignment).

      (Z(:^

      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