scrollWidth and scrollHeight in scrollView not working?

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? :slight_smile:

 Jay

PS - My scrollView is the width/height of the screen – no mask in this example.

So…nobody else has seen this? It’s just me? :slight_smile:

 Jay

I have seen this as well and simply thought I am misunderstanding what these guys are meant to do. Glad to see its not just me. 

I’m seeing the same thing too! 

Same here. Is anyone from Corona able to comment?

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.

Example:

local scrollListOptions = { width = display.contentWidth, height = display.contentHeight, scrollWidth = display.contentWidth, scrollHeight = display.contentHeight \* 2, } myScrollView = widget.newScrollView(scrollListOptions)

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.

So…nobody else has seen this? It’s just me? :slight_smile:

 Jay

I have seen this as well and simply thought I am misunderstanding what these guys are meant to do. Glad to see its not just me. 

I’m seeing the same thing too! 

Same here. Is anyone from Corona able to comment?

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.

Example:

local scrollListOptions = { width = display.contentWidth, height = display.contentHeight, scrollWidth = display.contentWidth, scrollHeight = display.contentHeight \* 2, } myScrollView = widget.newScrollView(scrollListOptions)

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.

My scrollview objects also seem to pick a default value, which appears to be the height and width of the screen, and no more.

Hey guys,

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.

alex

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.

Also, is the API wrong?

http://docs.coronalabs.com/api/library/widget/newScrollView.html

States:

scrollWidth, scrollHeight (required)

Yet looking at the sample code provided with 1227, it doesn’t show scrollWidth or scrollHeight

– Create a ScrollView
local scrollView = widget.newScrollView
{
    left = 0,
    top = 0,
    width = display.contentWidth,
    height = display.contentHeight,
    bottomPadding = 50,
    id = “onBottom”,
    horizontalScrollDisabled = false,
    verticalScrollDisabled = true,
    listener = scrollListener,
}

My scrollview objects also seem to pick a default value, which appears to be the height and width of the screen, and no more.

Hey guys,

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.

alex

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.

Also, is the API wrong?

http://docs.coronalabs.com/api/library/widget/newScrollView.html

States:

scrollWidth, scrollHeight (required)

Yet looking at the sample code provided with 1227, it doesn’t show scrollWidth or scrollHeight

– Create a ScrollView
local scrollView = widget.newScrollView
{
    left = 0,
    top = 0,
    width = display.contentWidth,
    height = display.contentHeight,
    bottomPadding = 50,
    id = “onBottom”,
    horizontalScrollDisabled = false,
    verticalScrollDisabled = true,
    listener = scrollListener,
}

scrollView:setScrollHeight() doesnt work for me, too

Any update on this?  Facing the same issue.

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.

More information here:

http://forums.coronalabs.com/topic/43969-scrolling-issue-scrollbar-jumps/

scrollView:setScrollHeight() doesnt work for me, too

Any update on this?  Facing the same issue.