Playing around with scrollView (using the github widgets) and scrollWidth and scrollHeight don’t seem to be having any effect. Based on the docs it appears that if I set scrollWidth to 1000 I should have a scrolling area of 1000 pixels in width…
…unless I insert something wider than 1000, in which case scrollWidth expands to fit that.
But what I’m seeing is setting scrollWidth to 2800, inserting an object that’s 1800 wide, and scrollWidth seems to be contracting to match that – I don’t have extra width on the side.
Am I misunderstanding scrollWidth and scrollHeight? Or are they really useless?
Jay
PS - My scrollView is the width/height of the screen – no mask in this example.
I’ve actually noticed this for some time, but like ksan I assumed I had misunderstood how to use it.
Just to be sure I’m doing it correctly, I’m using width and height to set how big the scrollview should appear, and scrollWidth and scrollHeight to set the total amount of usable space within the scrollview.
Ignoring the top, left, friction arguments for now, am I correct in thinking that this SHOULD give me a scrollview that appears to be one screen wide and high, but is scrolls enough to contain 2 screen heights of content?
If so, then it doesn’t work as of build 1207. Even if set scrollHeight to 0, nothing changes. It seems to just pick a default scrollHeight and stick with that.
I’ve actually noticed this for some time, but like ksan I assumed I had misunderstood how to use it.
Just to be sure I’m doing it correctly, I’m using width and height to set how big the scrollview should appear, and scrollWidth and scrollHeight to set the total amount of usable space within the scrollview.
Ignoring the top, left, friction arguments for now, am I correct in thinking that this SHOULD give me a scrollview that appears to be one screen wide and high, but is scrolls enough to contain 2 screen heights of content?
If so, then it doesn’t work as of build 1207. Even if set scrollHeight to 0, nothing changes. It seems to just pick a default scrollHeight and stick with that.
The scrollView actually auto-updates the width / height based on objects inserted into it. If you use the provided methods scrollView:setScrollWidth() and scrollView:setScrollHeight() you should be able to set the width / height properly after instantiating.
Alexf, scrollView:setScrollWidth() seems to do absolutely nothing for me. I can give it a ridiculously large value and the scrollview will still be stuck with the scroll width based on the objects inserted into it.
The scrollView actually auto-updates the width / height based on objects inserted into it. If you use the provided methods scrollView:setScrollWidth() and scrollView:setScrollHeight() you should be able to set the width / height properly after instantiating.
Alexf, scrollView:setScrollWidth() seems to do absolutely nothing for me. I can give it a ridiculously large value and the scrollview will still be stuck with the scroll width based on the objects inserted into it.
I can stay that setScrollHeight() did work for me in the sense that I could set it to a large value and it would add a bunch of blank space after the end of my content. But I had to add a lot of more, because if I set it to the how much content was actually in it, it would not scroll to the bottom of that content. I think their calculations of the scroll height is just wrong.
I logged a bug for the scrollView issues I was seeing.