Scrollview behavior on Graphics 2.0

Migrating to graphics 2.0 on one of my current apps and getting 2 really weird scrollview problems.  Note that I am using graphics compatibility mode.

Problem 1:  

When the scrollView is created and loaded with content, it doesn’t also start at the top of the scrollView.  For example, I created a scrollView, add a bunch of content, and now it’s first appearing about 1/3 of the way scrolled down.  If I drag up a bit it will then snap to the correct place at the top.  Also of note is if I do a scrollTo(“top”, 0) then it actually scrolls all the content to the middle of the screen not the top, and another drag of the scrollview will fix it and spring to the correct location.  Here’s the code I use to create the scrollView. 

 scrollView = widget.newScrollView { left = 0, top = titleText.y+titleText.height/2, width = screenWidth, height = screenHeight, id = "onBottom", friction = .942, --.962, horizontalScrollingDisabled = true, verticalScrollingDisabled = false, hideBackground = true, hideScrollBar = true, topPadding = 0, bottomPadding = 0, listener = scrollListener, } scrollView.\_view.\_isHorizontalScrollingDisabled = true scrollView:setReferencePoint( display.TopCenterReferencePoint ) scrollView.x = screenMiddleX scrollView.y = titleText.y+titleText.height/2 group:insert(scrollView) 

Problem 2:

The second problem is that there is always a bunch of space at the end of a scrollView, even with bottomPadding = 0.  There is usually a half a screen (240ish pixels) of empty space no matter what I make the height of my scrollView.  I have a few things I want to anchor to the end of the scrollView, but no matter what I do it always scrolls past whenever I put this anchors.

Any ideas?  Haven’t reported them as bugs yet because it could just be me not fully understanding some of the Graphics 2.0 changes.

Hi kbradford,

What are you inserting in the scrollView, and at which coordinates? The scrollview in v1 compatibility mode should behave exactly like the Graphics1 one did…

alex

Inserting a variety of graphics and text, and use a y value to keep incrementing where to place it further down the scrollview.  For example:

local currY = 0 for i=1,20 do local text = display.newText("Some text", 0, 0, screenWidth, 0, fonts["Museo"], 14) text:setReferencePoint( display.CenterLeftReferencePoint ) text:setTextColor(25, 180, 146) text.x = screenLeft+22 text.y = currY+text.height/2 scrollView:insert( text ) currY = currY + 50 end

I tried to use compatibility mode (graphicsCompatibility = 1) with build #2085

scrollView behaves different for me also.

The problem is exactly like kbradford said above

(1) there is an extra space on the top and if I scroll down, it backs to normal (the space is gone)

(2) there is a huge space at the bottom

If it is changed to iPad simulator/device, the first problem is gone but there is another problem that there is an extra space on the left.

Ok, seems like a bug. Could you please post one and paste the number back on the thread?

Thanks,

Alex.

Submitted as a bug, Case 28253.  Thanks!

The case is incomplete, unfortunately. Please submit a case that runs, and includes a config.lua. Your submitted file contains variables you define previously, please remove them or paste in the code that instantiates their values.

Thanks in advance,

Alex

Done, case 28255

Thank you.

Alex

By the way, this problem does not exist if migrating to 2.0 instead of using compatibility flag.

I am having the same issue here. Looking forward for a prompt fix.

Thanks!

Alex

Hi kbradford,

What are you inserting in the scrollView, and at which coordinates? The scrollview in v1 compatibility mode should behave exactly like the Graphics1 one did…

alex

Inserting a variety of graphics and text, and use a y value to keep incrementing where to place it further down the scrollview.  For example:

local currY = 0 for i=1,20 do local text = display.newText("Some text", 0, 0, screenWidth, 0, fonts["Museo"], 14) text:setReferencePoint( display.CenterLeftReferencePoint ) text:setTextColor(25, 180, 146) text.x = screenLeft+22 text.y = currY+text.height/2 scrollView:insert( text ) currY = currY + 50 end

I tried to use compatibility mode (graphicsCompatibility = 1) with build #2085

scrollView behaves different for me also.

The problem is exactly like kbradford said above

(1) there is an extra space on the top and if I scroll down, it backs to normal (the space is gone)

(2) there is a huge space at the bottom

If it is changed to iPad simulator/device, the first problem is gone but there is another problem that there is an extra space on the left.

Ok, seems like a bug. Could you please post one and paste the number back on the thread?

Thanks,

Alex.

Submitted as a bug, Case 28253.  Thanks!

The case is incomplete, unfortunately. Please submit a case that runs, and includes a config.lua. Your submitted file contains variables you define previously, please remove them or paste in the code that instantiates their values.

Thanks in advance,

Alex

Done, case 28255

Thank you.

Alex

By the way, this problem does not exist if migrating to 2.0 instead of using compatibility flag.