ScrollView scrolling vertically with verticalScrollDisable=true - what am I doing wrong?

Horozontal scroll works great.  The scrollview still scrolls vertically though…

I’m using  verticalScrollDisabled = true.   Has there been a change recently or am I missing something?  Thanks.

Try scrollView._view._isVerticalScrollingDisabled = true

Thanks for the tip - unfortunately didn’t work though :frowning:

Which build are you on? As of 2189 it is still working well on my code.

the latest…  2205 I believe.   My scrollView is only about 100px high, yet the scroll contents inside are very wide…   seems to scroll just fine, but when I start to drag up or down it works for a bit (vertical scroll seems disabled), then all of a sudden it snaps and vertical scroll starts working.

This is definitely still not working…  anyone from Corona have any tips?

Can you post some sample code that does this?

Sure thing…

selector = widget.newScrollView { top = stage.halfheight, left = 0, width = stage.width, height = height, -- a var equal to 84 scrollWidth = stage.width, scrollHeight = height, rightPadding = stage.width \* 0.76, verticalScrollDisabled = true, hideBackground = true, listener = function(event) self:listenToSelector(event) end } selector.\_view.\_isVerticalScrollingDisabled = true selector:translate(0, -(selector.height/2))

“stage” is a lib that I use to calculate device screen width/height…

After initializing this, I create a group called “scrollgroup”, insert that into the selector, then insert 100 buttons into scrollgroup - all laid out in a line horizontally.   The width of scrollgroup then is quite large (almost 8000px wide).  I then run this…

selector:setScrollWidth(scrollgroup.width)

After all is said and done, the selector (scrollView) is scrollable horizontally AND vertically.

I even tried adding this again, at the end after the setScrollWidth() call:

selector.\_view.\_isVerticalScrollingDisabled = true

Would like to get this fixed and submit my game!  This is the last issue before submission…  thanks :slight_smile:

Few things I would try

first off, get rid of verticalScrollDisabled = true, from the constructor. 

comment selector:translate(0, -(selector.height/2)) . not sure about this one.

Can you try inserting just 3 or 4 items into the scrollgroup and see if this makes a difference?

Lastly, can you at the end of the code also check and print the height of the scrollgroup? Is it equal to 84 or more?

Hope this helps somehow. It is very puzzling indeed. 

Might be an issue if scroll height is smaller than the widget height. Try adding items so the content is taller than the widget height.

Also you can try to not set scrollHeight in constructor. Scroll view will adjust it automatically based on the items inserted.

Try scrollView._view._isVerticalScrollingDisabled = true

Thanks for the tip - unfortunately didn’t work though :frowning:

Which build are you on? As of 2189 it is still working well on my code.

the latest…  2205 I believe.   My scrollView is only about 100px high, yet the scroll contents inside are very wide…   seems to scroll just fine, but when I start to drag up or down it works for a bit (vertical scroll seems disabled), then all of a sudden it snaps and vertical scroll starts working.

This is definitely still not working…  anyone from Corona have any tips?

Can you post some sample code that does this?

Sure thing…

selector = widget.newScrollView { top = stage.halfheight, left = 0, width = stage.width, height = height, -- a var equal to 84 scrollWidth = stage.width, scrollHeight = height, rightPadding = stage.width \* 0.76, verticalScrollDisabled = true, hideBackground = true, listener = function(event) self:listenToSelector(event) end } selector.\_view.\_isVerticalScrollingDisabled = true selector:translate(0, -(selector.height/2))

“stage” is a lib that I use to calculate device screen width/height…

After initializing this, I create a group called “scrollgroup”, insert that into the selector, then insert 100 buttons into scrollgroup - all laid out in a line horizontally.   The width of scrollgroup then is quite large (almost 8000px wide).  I then run this…

selector:setScrollWidth(scrollgroup.width)

After all is said and done, the selector (scrollView) is scrollable horizontally AND vertically.

I even tried adding this again, at the end after the setScrollWidth() call:

selector.\_view.\_isVerticalScrollingDisabled = true

Would like to get this fixed and submit my game!  This is the last issue before submission…  thanks :slight_smile:

Few things I would try

first off, get rid of verticalScrollDisabled = true, from the constructor. 

comment selector:translate(0, -(selector.height/2)) . not sure about this one.

Can you try inserting just 3 or 4 items into the scrollgroup and see if this makes a difference?

Lastly, can you at the end of the code also check and print the height of the scrollgroup? Is it equal to 84 or more?

Hope this helps somehow. It is very puzzling indeed. 

Might be an issue if scroll height is smaller than the widget height. Try adding items so the content is taller than the widget height.

Also you can try to not set scrollHeight in constructor. Scroll view will adjust it automatically based on the items inserted.