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. ListView scrolls down when prepending items
Forum Updated to NodeBB v4.3 + New Features

ListView scrolls down when prepending items

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 168 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.
  • M Offline
    M Offline
    Michel de Boer
    wrote on last edited by
    #1

    I have developed a social media app. I use a ListView to display the timeline of posts. When new posts come in I prepend those at the top of the list. This causes the lists to scroll down sometimes. I see have observed the following:

    1. If first visible item is the first item of the list then prepending items scrolls down the list causing the new items to become visible.
    2. If the first visible item is an item further down the list then the above does not happen, if the item height is fixed (see next point)
    3. The items are highly dynamically, e.g. some posts have images or other attachments. This means the height of the item is not final when it is prepended, e.g. the post text is already there by an Image with a http-url as source is still empty as the http requests is in flight. When the image is received the height of the entry increases. When this happens, all items below are push down. To the user it seems that his timeline suddenly jumps in downwards direction.

    In all cases I want the timeline to be stable, i.e. not move at all. Items above the visible area should resize in upwards direction instead of downwards.

    Any ideas how to do this?

    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