scrollView problem with :setScrollHeight( newHeight )

CoronaSDK 2013.2097

Graphics 2.0 mode

This happens after graphics 2.0 update.

  1. When I run scrollViewObj:scrollHeight( newHeight ). It reset scroll position Y to zero. even if I moving scrollView.

2. scrollTo(‘bottom’, {time=…}) works abnormal.

It scrolls to center of scroll view. not bottom.

scrollTo(‘top’, …) works normal.

  1. scrollViewObj:scrollTo( … ) does not stops moving of scrollView.

Hi there,

Could you please provide some code, to be able to determine what the issue is?

Thanks,

Alex

Hi, Alex.

This is sample code

-- Sample code (screen size 960x640, landscape mode) local widget = require 'widget' local scrollViewHeight = 495 -- make scrollView local scrollView = widget.newScrollView{     left=60, top=60,     -- 770x495     width=770, height=scrollViewHeight,     scrollWidth=770, scrollHeight=scrollViewHeight,     hideBackground = false,     backgroundColor = {0.2,0.2,0.2},     isHitTestMasked = true,     horizontalScrollDisabled = true,     maskFile = "images/mask/400x400.png" } scrollView.maskScaleX = 770/400 scrollView.maskScaleY = scrollViewHeight/400      -- texts local textGroup = display.newGroup() local textLines = 50 for i = 1, textLines do     local text = display.newText{ parent=textGroup, text = 'Hello Corona. '..i, fontSize=21}     text.x, text.y = 0, i\*22 end scrollView:insert( textGroup ) textGroup.x, textGroup.y = 100, 100 -- scrollToBottom button local bottomBtn = display.newRect( 0,0, 100, 20 ) bottomBtn.x, bottomBtn.y = 480, 620 bottomBtn:addEventListener('touch', function(e)     if e.phase == 'began' then         -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*         -- \*\*\*\*\*\* weird scroll position \*\*\*\*\*\*\*         -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*         scrollView:scrollTo('bottom', {time=100})     end end) -- delayed contents height changing (set random height to show what happens) timer.performWithDelay(2000, function()     local randomHeight = textGroup.height + math.random(1, 100)     print('randomHeight: '..randomHeight)     -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*     -- \*\*\*\*\* this forces scroll to top \*\*\*\*     -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*     scrollView:setScrollHeight( randomHeight ) end, 0)  

Best regards.

I also have the same problem when I reset ScrollHeight  :huh:

scrollView:setScrollHeight( scrollViewHeight )

@zetaloki4, Captured this one in the “unofficial” widgets bug list. Please report back when its fixed. Thanks much!!!

Is there a bug report for this bug?  If so  can you post the number here for a reference?  If not, please file one.

Thanks

Rob

Hi there,

Could you please provide some code, to be able to determine what the issue is?

Thanks,

Alex

Hi, Alex.

This is sample code

-- Sample code (screen size 960x640, landscape mode) local widget = require 'widget' local scrollViewHeight = 495 -- make scrollView local scrollView = widget.newScrollView{     left=60, top=60,     -- 770x495     width=770, height=scrollViewHeight,     scrollWidth=770, scrollHeight=scrollViewHeight,     hideBackground = false,     backgroundColor = {0.2,0.2,0.2},     isHitTestMasked = true,     horizontalScrollDisabled = true,     maskFile = "images/mask/400x400.png" } scrollView.maskScaleX = 770/400 scrollView.maskScaleY = scrollViewHeight/400      -- texts local textGroup = display.newGroup() local textLines = 50 for i = 1, textLines do     local text = display.newText{ parent=textGroup, text = 'Hello Corona. '..i, fontSize=21}     text.x, text.y = 0, i\*22 end scrollView:insert( textGroup ) textGroup.x, textGroup.y = 100, 100 -- scrollToBottom button local bottomBtn = display.newRect( 0,0, 100, 20 ) bottomBtn.x, bottomBtn.y = 480, 620 bottomBtn:addEventListener('touch', function(e)     if e.phase == 'began' then         -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*         -- \*\*\*\*\*\* weird scroll position \*\*\*\*\*\*\*         -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*         scrollView:scrollTo('bottom', {time=100})     end end) -- delayed contents height changing (set random height to show what happens) timer.performWithDelay(2000, function()     local randomHeight = textGroup.height + math.random(1, 100)     print('randomHeight: '..randomHeight)     -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*     -- \*\*\*\*\* this forces scroll to top \*\*\*\*     -- \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*     scrollView:setScrollHeight( randomHeight ) end, 0)  

Best regards.

I also have the same problem when I reset ScrollHeight  :huh:

scrollView:setScrollHeight( scrollViewHeight )

@zetaloki4, Captured this one in the “unofficial” widgets bug list. Please report back when its fixed. Thanks much!!!

Is there a bug report for this bug?  If so  can you post the number here for a reference?  If not, please file one.

Thanks

Rob