I experience this as well, (although it doesn’t bug me too much… pun ) it would be epic if that can be fixed… but as a dev and just from seeing it, I wouldn’t even know where to begin to debug this.
The issues at the top and bottom when it jumps is I think what joe528 was having a problem with. This is fixed in my fix above. Just to confirm it is the same problem try this exactly:
scroll down a bit
scroll quickly so it reaches top
before it bounces back scroll down and let go. (this has to be done quickly because bounce back is quick)
now if you do this the problem is that the bounce back has not completed while you already started to scroll down again in it will jump
back to top then scroll down again from momentum.
If this is it then it’s fixed in what I posted above. Read the post on how to use it. It needs a different require set to a new variable to use it. The files have to be in a separate folder as they are in the zip.
To make sure you are using my version you can put a print on line 523 in widget_scrollview.lua. Thats just after this line:
function M.new( options )
print(“Fixed”) --put this in
Look for it in the terminal.
Now about the scroll bar. I have not seen this issue. I read about it in the forums but never encountered it. Are you by any chance dynamically inserting and removing items while scrolling? In this case the scroll bar will act strangely. Another thing I can think of is if you insert all the objects in the same position (top) and only after move them down. In this case some strangeness might also occur. After you have set all the items in the scroll view or when you reposition them inside the scroll view, if you are using my version you can call scrollView:updateScrollAreaSize(). This might help as I used it on occasion when I moved things inside the scroll view and the scroll area did not update. If you can come up with a simple project that demonstrates it I can take a look at it.
@primoz.cerar - hey buddy, i have not tried the recent version you posted, however the new tableView (scroll to top fix) broke my app… is there something that was left out?
As mentioned in PM please check the phones log for errors.
Did you use the table view from my fix before and only now it broke when I added the scrollToY fix or did you not use it before?
I know it works in iPhone as I have another app with these fixes that work on iPhone without a problem.
I don’t have one with me to test now.
Got it. Sorry about that. Made a mistake in file names.
Take the updated zip or just rename widget_tableview.lua to all lower case letters. It had an upper case V which caused the error.
Rookie mistake
lol yup that was it =P
I am going to publish my app with this fix soon.
While primoz.cerar fix is fantastic, my questions are:
(1) How am I going to maintain the “branches” of widgets, now my source code has this widget fix and also another widget fix for segmentedControl (a bug that segmentedControl is not working correctly while it’s put on a scrollView)
Is my source code going to have more and more widget patches?
(2) If I have a bug for widget, whom should I report to?
This made me laugh a bit
Well you should report to CL with the bug report tool, but you never know when the engineers will get to it.
Regarding maintaining the different versions what I do is for the widgets I need fixes for I use the github version with my fixes, for others I use the built in ones. When I see the issues have been fixed by CL I would revert back to built in version (in reality I never do this as I don’t have access to daily builds), but since there are usualy multiple bugs and only some get fixed I stick with my version and nag the CL staff to update the github repository. When it’s updated I merge the CL fixes with my own and use that.
Edit: If you have a bug that you see with my version and not the built in one then you should PM me and not file a bug report obviously. I offer no guarantees, I’m just trying to get you past the issues you are having as I have already had to deal with most of them and I felt like sharing.
The scrollView fix Rob mentioned earlier seems to be included in the latest Corona build 2189 (https://developer.coronalabs.com/release/2014/2189/):
- Widget: Fixing the scrollview jumping to 0,0 after inserting content, casenum #30775. Improving the limit calculation on scrollviews. Fixing the scrollToY method of the tableView to stop velocity before transitioning.
The second phrase “Improving the limit calculation on scrollviews” sounds like a fix for this problem…
So I tested with 2189 about this scrollView jerkiness problem…
Guess what?
It’s NOT fixed.
Only primoz.cerar’s fix is the one that really fixes this problem.
Corona, please keep going for this problem. It’s NOT fixed yet.
i am having a problem with the scrollview, where a bug in the ‘setScrollHeight’ feature.
After creating a scroll view and setting the height (using ‘setScrollHeight’), the scroll-down effect is messed up.
Bug case : #31096
Sample code (based on Corona’s samples) :
-- -- Abstract: Scroll View sample app -- -- Version: 2.0 -- -- Sample code is MIT licensed, see http://www.coronalabs.com/links/code/license -- Copyright (C) 2010 Corona Labs Inc. All Rights Reserved. -- -- Demonstrates how to make text and graphics move up and down on touch, -- or scroll, using the widget libraries scrollView methods. -- -- Supports Graphics 2.0 ------------------------------------------------------------ display.setStatusBar( display.HiddenStatusBar ) local widget = require( "widget" ) -- Our ScrollView listener local function scrollListener( event ) local phase = event.phase local direction = event.direction if "began" == phase then --print( "Began" ) elseif "moved" == phase then --print( "Moved" ) elseif "ended" == phase then --print( "Ended" ) end -- If the scrollView has reached it's scroll limit if event.limitReached then if "up" == direction then print( "Reached Top Limit" ) elseif "down" == direction then print( "Reached Bottom Limit" ) elseif "left" == direction then print( "Reached Left Limit" ) elseif "right" == direction then print( "Reached Right Limit" ) end end return true end -- Create a ScrollView local scrollView = widget.newScrollView { left = 0, top = 0, width = display.contentWidth, height = display.contentHeight, bottomPadding = 50, id = "onBottom", horizontalScrollDisabled = true, verticalScrollDisabled = false, listener = scrollListener, } --Create a text object for the scrollViews title local titleText = display.newText("Move Up to Scroll", display.contentCenterX, 48, native.systemFontBold, 16) titleText:setFillColor( 0 ) -- insert the text object into the created display group scrollView:insert( titleText ) --Create a large text string local lotsOfText = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet consectetur euismod. Phasellus non ipsum vel eros vestibulum consequat. Integer convallis quam id urna tristique eu viverra risus eleifend.\n\nAenean suscipit placerat venenatis. Pellentesque faucibus venenatis eleifend. Nam lorem felis, rhoncus vel rutrum quis, tincidunt in sapien. Proin eu elit tortor. Nam ut mauris pellentesque justo vulputate convallis eu vitae metus. Praesent mauris eros, hendrerit ac convallis vel, cursus quis sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum, dui in vehicula dapibus, lorem nisi placerat turpis, quis gravida elit lectus eget nibh. Mauris molestie auctor facilisis.\n\nCurabitur lorem mi, molestie eget tincidunt quis, blandit a libero. Cras a lorem sed purus gravida rhoncus. Cras vel risus dolor, at accumsan nisi. Morbi sit amet sem purus, ut tempor mauris.\n\nLorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet consectetur euismod. Phasellus non ipsum vel eros vestibulum consequat. Integer convallis quam id urna tristique eu viverra risus eleifend.\n\nAenean suscipit placerat venenatis. Pellentesque faucibus venenatis eleifend. Nam lorem felis, rhoncus vel rutrum quis, tincidunt in sapien. Proin eu elit tortor. Nam ut mauris pellentesque justo vulputate convallis eu vitae metus. Praesent mauris eros, hendrerit ac convallis vel, cursus quis sem. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque fermentum, dui in vehicula dapibus, lorem nisi placerat turpis, quis gravida elit lectus eget nibh. Mauris molestie auctor facilisis.\n\nCurabitur lorem mi, molestie eget tincidunt quis, blandit a libero. Cras a lorem sed purus gravida rhoncus. Cras vel risus dolor, at accumsan nisi. Morbi sit amet sem purus, ut tempor mauris. " --Create a text object containing the large text string and insert it into the scrollView local lotsOfTextObject = display.newText( lotsOfText, display.contentCenterX, 0, 300, 0, "Helvetica", 14) lotsOfTextObject:setFillColor( 0 ) lotsOfTextObject.anchorY = 0.0 -- Top --------------------------------lotsOfTextObject:setReferencePoint( display.TopCenterReferencePoint ) lotsOfTextObject.y = titleText.y + titleText.contentHeight + 10 scrollView:insert( lotsOfTextObject ) -- Adjust scroll height scrollView:setScrollHeight( 250 )
That is because you’ve set scroll height that is less than the height of the scroll view widget itself. You should not have to do that. At least i don’t see a use for it, I may be wrong.
Though there should be a check for that in the scroll view itself so this doesn’t happen.
primoz.cerar is right. If you don’t set the height less than scrollView’s, there shouldn’t be a problem. I happened running into this issue couple days ago. So I had to check the scrollHeight before I set (in my case, my content height is dynamic). Of course, if you think scrollview should do the checking, probably it’s doable. But you have to either ask widget master primoz.cerar or Corona, I am not really sure.
By the way, please create another thread for your issue if you still feel like to discuss because the original problem in this post has not been fixed by Corona yet, so please don’t divert them to something else. We finally brought up their attention to this issue after 3 pages of discussion.
Hi there,
I’m facing the problem of a choppy scroll view and would like to ask if it’s fixed or if theres any solution to this yet? Tried the widgetFix mod by primoz but it didnt fix the choppy issue yet.
Regards,
Vincent
There should be some scrollView fixes coming soon in a daily build. Lets see if any of those fixes address this.
Rob
Okay thanks Rob!
I don’t know if this is related to the issue you guys are talking about, but I’ve got a problem with the scrollview where the momentum scrolling sometimes just doesn’t react as well as it should.
It’s hard to describe, but sometimes “flinging” the scrollview doesn’t work, and the scrollview just moves up to where my finger left the screen instead of scrolling quickly as I intended.
Thanks,
Dave
Hi there,
I’m facing the problem of a choppy scroll view and would like to ask if it’s fixed or if theres any solution to this yet? Tried the widgetFix mod by primoz but it didnt fix the choppy issue yet.
Regards,
Vincent
There should be some scrollView fixes coming soon in a daily build. Lets see if any of those fixes address this.
Rob
Okay thanks Rob!
I don’t know if this is related to the issue you guys are talking about, but I’ve got a problem with the scrollview where the momentum scrolling sometimes just doesn’t react as well as it should.
It’s hard to describe, but sometimes “flinging” the scrollview doesn’t work, and the scrollview just moves up to where my finger left the screen instead of scrolling quickly as I intended.
Thanks,
Dave