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.

binamenator
  • 193
  • 1
  • 6
user2563892
  • 590
  • 6
  • 13
  • 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. – Barafu Albino Aug 05 '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. – user2563892 Aug 05 '14 at 16:48
  • 1
    Yes, please leave this question here where it will benefit other Ubuntu app developers – mhall119 Aug 05 '14 at 18:14
  • @mhall119 Thanks for standing up for me, at least they'll listen to you :) – user2563892 Aug 05 '14 at 18:21
  • 3
    @BarafuAlbino This question is perfectly fine here. Questions about development on Ubuntu are on-topic per the [help/on-topic]. – Seth Aug 05 '14 at 23:19
  • This may be an easy one if you provide a complete (non-working) example to fix -- anyone still interested in an answer? – mlvljr Mar 18 '18 at 20:52

1 Answers1

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.

binamenator
  • 193
  • 1
  • 6