Scrollable View isn't smooth on iPad
Hi, I've got problem with ScrollableView. Even when displayed views are "preloaded" (added to ScrollableView object), scrolling using "swipe" isn't smooth. Sometimes it's OK (images are "binded" together) but most of the time it's like image A is moving away, and is replaced by black screen and then image B appears (it's really random).
Is it a bug?
3 Answers
-
Can you provide a test case to reproduce? A quick test on my end for scrollable view seems to work pretty well.
-
That's the way it works. Not all views will be preloaded, i observed it only load 3 at once. Which makes sense, otherwise, it may never load or crash instantly if you have big batch of huge size images files trying to load at the same time.
If you are insistingly of using it, try add a spinner on the background (the black screen u described) imageview object before load. Still, it's not smooth as how i like it.
Instead of scroableview, i use touchstart and touchend to register "swipe" direction then replace the image. Not as visual as scrollable but it won't crash as often. BTW, don't use Swipe event, it triggers multiple times.
-
test case
Titanium.UI.setBackgroundColor('#000'); Titanium.UI.orientation = Titanium.UI.LANDSCAPE_LEFT; var win = Titanium.UI.createWindow({ top: 0, left: 0, width: 1024, height: 748 }); win.orientationModes = [ Titanium.UI.LANDSCAPE_LEFT ]; var s = Titanium.UI.createScrollableView({ maxZoomScale:2.0, top: 0, left: 0, width: 1024, height: 748, pagingControlHeight:60 }); var v0 = Titanium.UI.createView({backgroundColor:'#f22', width: 1024, height: 748, }); var v1 = Titanium.UI.createView({backgroundColor:'#d66', width: 1024, height: 748, }); var v2 = Titanium.UI.createView({backgroundColor:'#066', width: 1024, height: 748, }); var v3 = Titanium.UI.createView({backgroundColor:'#a6a', width: 1024, height: 748, }); var v4 = Titanium.UI.createView({backgroundColor:'#0dd', width: 1024, height: 748, }); var v5 = Titanium.UI.createView({backgroundColor:'#a60', width: 1024, height: 748, }); s.addView(v0); s.addView(v1); s.addView(v2); s.addView(v3); s.addView(v4); s.addView(v5); win.add(s); win.open();
When you scroll back and forth, sometimes colored background is not moving into screen but black background is and only then color appears. The same issue with images, only more visible and random (try load some 300-400KB images as background images)