ScrollView horizontal scrolling

My scroll view widget will not scroll all the way to the right and stay. It will show the images on the far right but will bounce back and they are hidden (off screen) once you release it.

Here is how I’m setting up my widget:

local scrollView = widget.newScrollView { top = display.contentHeight - 155, left = 5, width=display.contentWidth - 10, height = 50, scrollWidth = display.contentWidth + 200, scrollHeight = 50, verticalScrollDisabled=true, isHitTestMasked = true, hideBackground=true } [import]uid: 64619 topic_id: 36534 reply_id: 336534[/import]

I think I found the part that is causing the issue but I’m not sure why. I am using a transition to move my images to the end of the scroll view (transition.to). If I set the x position without using the transition it works fine.

[import]uid: 64619 topic_id: 36534 reply_id: 144836[/import]

Hey Jason.

I would advise using the scrollVIew methods (scrollToPosition) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollToPosition.html

or (scrollTo) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollTo.html

To move your scrollView instead of using your own transition.to calls. [import]uid: 84637 topic_id: 36534 reply_id: 144963[/import]

I wasn’t using the transition on the scrollView but the items in the scroll view. I had images transition to a position in (over) the scrollView and on completion, insert them in the scrollView. The insert in to the scrollView works correctly BUT it doesn’t calculate the scroll width correctly, it appears. [import]uid: 64619 topic_id: 36534 reply_id: 144971[/import]

Oh ok.

Question: Are you using daily build 1040?
[import]uid: 84637 topic_id: 36534 reply_id: 144972[/import]

Sounds like it might be fixed in 1041 as that was the issue. I’ll see if it resolves it and update this thread.

“21249: Widget 2.0: ScrollView: Scroll Width/Height not recalculated with added content” [import]uid: 64619 topic_id: 36534 reply_id: 145078[/import]

It wasn’t fixed in 1041 unfortunately Jason, it will be either the next daily build after today or the day after hopefully. [import]uid: 84637 topic_id: 36534 reply_id: 145080[/import]

No worries, thanks for the update. [import]uid: 64619 topic_id: 36534 reply_id: 145082[/import]

I think I found the part that is causing the issue but I’m not sure why. I am using a transition to move my images to the end of the scroll view (transition.to). If I set the x position without using the transition it works fine.

[import]uid: 64619 topic_id: 36534 reply_id: 144836[/import]

Hey Jason.

I would advise using the scrollVIew methods (scrollToPosition) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollToPosition.html

or (scrollTo) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollTo.html

To move your scrollView instead of using your own transition.to calls. [import]uid: 84637 topic_id: 36534 reply_id: 144963[/import]

I wasn’t using the transition on the scrollView but the items in the scroll view. I had images transition to a position in (over) the scrollView and on completion, insert them in the scrollView. The insert in to the scrollView works correctly BUT it doesn’t calculate the scroll width correctly, it appears. [import]uid: 64619 topic_id: 36534 reply_id: 144971[/import]

Oh ok.

Question: Are you using daily build 1040?
[import]uid: 84637 topic_id: 36534 reply_id: 144972[/import]

Sounds like it might be fixed in 1041 as that was the issue. I’ll see if it resolves it and update this thread.

“21249: Widget 2.0: ScrollView: Scroll Width/Height not recalculated with added content” [import]uid: 64619 topic_id: 36534 reply_id: 145078[/import]

It wasn’t fixed in 1041 unfortunately Jason, it will be either the next daily build after today or the day after hopefully. [import]uid: 84637 topic_id: 36534 reply_id: 145080[/import]

No worries, thanks for the update. [import]uid: 64619 topic_id: 36534 reply_id: 145082[/import]

I think I found the part that is causing the issue but I’m not sure why. I am using a transition to move my images to the end of the scroll view (transition.to). If I set the x position without using the transition it works fine.

[import]uid: 64619 topic_id: 36534 reply_id: 144836[/import]

Hey Jason.

I would advise using the scrollVIew methods (scrollToPosition) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollToPosition.html

or (scrollTo) http://docs.coronalabs.com/daily/api/type/ScrollViewWidget/scrollTo.html

To move your scrollView instead of using your own transition.to calls. [import]uid: 84637 topic_id: 36534 reply_id: 144963[/import]

I wasn’t using the transition on the scrollView but the items in the scroll view. I had images transition to a position in (over) the scrollView and on completion, insert them in the scrollView. The insert in to the scrollView works correctly BUT it doesn’t calculate the scroll width correctly, it appears. [import]uid: 64619 topic_id: 36534 reply_id: 144971[/import]

Oh ok.

Question: Are you using daily build 1040?
[import]uid: 84637 topic_id: 36534 reply_id: 144972[/import]

Sounds like it might be fixed in 1041 as that was the issue. I’ll see if it resolves it and update this thread.

“21249: Widget 2.0: ScrollView: Scroll Width/Height not recalculated with added content” [import]uid: 64619 topic_id: 36534 reply_id: 145078[/import]