28

So, while building an Ubuntu app I needed to use flickable for scrolling, so now I have code of the form

Page{
  ...
  Flickable {
    anchors.fill: parent
    content.height: element1.height + element2.height ...

    ...
  }
}

When I run it on my phone (ubuntu utopic), the default position of the flickable is a few hundred pixels lower than the header. When I flick it up, it stays in the correct position it's supposed to stay from the start. Also, when using pagestack to push another page, then come back to this one it stays in the right position. Why is this and how can I fix it, so that it can be in the right position from the start.

Note: I've tried many combinations with anchors, width, height, everything. One time I did get it to stay in the position, but when flicking up it overlapped the header.

6
  • 1
    This question really belongs to Stack Overflow. And you should provide bigger snippet of code: I think the culprit is in content. QML is very fragile and whimsical system with lots of illogical dependencies. Aug 5 '14 at 16:37
  • 2
    @BarafuAlbino I think it fits more here because I think it's very SDK specific, don't think that raw qml would behave this way. Also this could be a bug, as I sayd when flipping up it does stay in the right position. Aug 5 '14 at 16:48
  • 1
    Yes, please leave this question here where it will benefit other Ubuntu app developers
    – mhall119
    Aug 5 '14 at 18:14
  • @mhall119 Thanks for standing up for me, at least they'll listen to you :) Aug 5 '14 at 18:21
  • 3
    @BarafuAlbino This question is perfectly fine here. Questions about development on Ubuntu are on-topic per the help center.
    – Seth
    Aug 5 '14 at 23:19
1

There's way to little qml to see what's going on, especially since all components positions affect each other.

One solution would be to do the thing you did to get your flickable in the correct position, and then add the clip: true property to stop it from overlapping the header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.