Scrollview isBounceEnabled is Public not specific to object.

If you have two scroll views one with isBounceEnabled = false and one with isBounceEnabled = true the last scrollview to be declared resets “any” scrollview to isBounceEnabled = (what ever value the new scrollview is)…

example:

 scene.scrollView1 = uiObjects.newScrollView { top = 0, left = 0, width = 600, height = 200, scrollWidth = 600, scrollHeight = 200, verticalScollDisabled = true, hideScrollBar = true, hideBackground = true, isBounceEnabled = false, friction = 1 } scene.scrollView2 = uiObjects.newScrollView { top = 300, left = 0, width = 600, height = 200, scrollWidth = 600, scrollHeight = 200, verticalScollDisabled = true, hideScrollBar = true, hideBackground = true, isBounceEnabled = true, friction = 1 } 

It doesn’t matter if they are local scrollview1/2 etc. in my case they are in two different files all together but the above example will reproduce it no problem.

Before i go filing a bug report I just want to make sure I am not smoking crack again :slight_smile:

It’s a “global” setting for the lack of a better term apparently.  Please file a bug report and when you get the confirmation email, please post the bug number back here.

Thanks

Rob

Case 29419

Yeah couldn’t figure what else to call it “shared, public, etc.” figured global pretty much just says it all lol

Rob, 

I took a quick look at the code under the hood and notice that widget_momentumScrolling makes use of local M = {} to contain parameters. I suspect this is the reason why the isBounceEnabled = true/false setting last used updates this ‘global’ variable which then gets reused by scrollViews that don’t get re-created. Am I on the right track to understand this bug? Just an educational question. 

On a related note, perhaps M is not a safe table name for globals seeing that it is being used by Corona staff for widget globals. I think your excellent tutorial on the topic of not using Globals make use of M in an example : 

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/

Thought I might highlight this possible issue for others using M. Sorry for going off-topic. 

M is local to the module, so that’s not a problem. The problem has to do with how Lua only loads modules once. 

Rob

Is there a way to set that property without recreating the scroll view?

That would work for me as I only have the bounce enabled in a dialog so I could set it back to false after I close the dialog

Slimy isBounceEnabled hack so loading one scrollview with nobounce and then opening another scene with bounce enabled then coming back doesn’t set the first one to the last bounceEnabled property…

Slimy hack yes, works you betch ya…

function scene:BounceEnabled(enabled) local bugScroll = uiObjects.newScrollView { top = 0, left = 0, width = 0, height = 0, scrollWidth = 0, scrollHeight = 0, isBounceEnabled = enabled } pcall(function() bugScroll:removeSelf() end) pcall(function() bugScroll = nil end) end //Enabled bounce //self:BounceEnabled(true) //Disable Bounce //self:BounceEnabled(false)

Since scrollviews are all using the same bounceEnabled property this simple creates a scrollview real quick sets the bounceProperty then destroys it, which allows your main scrollview to work as intented :slight_smile:

When corona staff gets enough off their plate to look at the issue then will be simple enough just to remove the create scrollview with object.isBounceEnabled = enabled without having to go through all your code etc. :slight_smile:

This is for anyone who has a main scrollview on the page and you open something like a dialog with a scrollview inside of it, then close the dialog it will reset the bounceEnabled property to what ever the dialog scrollview was set at.

so for me i have a main scrollview that doesn’t have bounce enabled but in a dialog that pops up (list) it does have it enabled, so when you come back from that the main scrollview gets bounce enabled which messes up my ui :slight_smile:

It’s a “global” setting for the lack of a better term apparently.  Please file a bug report and when you get the confirmation email, please post the bug number back here.

Thanks

Rob

Case 29419

Yeah couldn’t figure what else to call it “shared, public, etc.” figured global pretty much just says it all lol

Rob, 

I took a quick look at the code under the hood and notice that widget_momentumScrolling makes use of local M = {} to contain parameters. I suspect this is the reason why the isBounceEnabled = true/false setting last used updates this ‘global’ variable which then gets reused by scrollViews that don’t get re-created. Am I on the right track to understand this bug? Just an educational question. 

On a related note, perhaps M is not a safe table name for globals seeing that it is being used by Corona staff for widget globals. I think your excellent tutorial on the topic of not using Globals make use of M in an example : 

https://coronalabs.com/blog/2013/05/28/tutorial-goodbye-globals/

Thought I might highlight this possible issue for others using M. Sorry for going off-topic. 

M is local to the module, so that’s not a problem. The problem has to do with how Lua only loads modules once. 

Rob

Is there a way to set that property without recreating the scroll view?

That would work for me as I only have the bounce enabled in a dialog so I could set it back to false after I close the dialog

Slimy isBounceEnabled hack so loading one scrollview with nobounce and then opening another scene with bounce enabled then coming back doesn’t set the first one to the last bounceEnabled property…

Slimy hack yes, works you betch ya…

function scene:BounceEnabled(enabled) local bugScroll = uiObjects.newScrollView { top = 0, left = 0, width = 0, height = 0, scrollWidth = 0, scrollHeight = 0, isBounceEnabled = enabled } pcall(function() bugScroll:removeSelf() end) pcall(function() bugScroll = nil end) end //Enabled bounce //self:BounceEnabled(true) //Disable Bounce //self:BounceEnabled(false)

Since scrollviews are all using the same bounceEnabled property this simple creates a scrollview real quick sets the bounceProperty then destroys it, which allows your main scrollview to work as intented :slight_smile:

When corona staff gets enough off their plate to look at the issue then will be simple enough just to remove the create scrollview with object.isBounceEnabled = enabled without having to go through all your code etc. :slight_smile:

This is for anyone who has a main scrollview on the page and you open something like a dialog with a scrollview inside of it, then close the dialog it will reset the bounceEnabled property to what ever the dialog scrollview was set at.

so for me i have a main scrollview that doesn’t have bounce enabled but in a dialog that pops up (list) it does have it enabled, so when you come back from that the main scrollview gets bounce enabled which messes up my ui :slight_smile: