Appcelerator - ScrollView setContentOffset Animated: false issue

ScrollView is a very nice UI component in Appcelerator that will handle pinch zoom and drag move their content view. By default the content view are at X = 0, Y = 0 location. What if I want to default the content views to center it?

You could use toScroll or setContentOffset to move the inner content view. Both of these method invoke an animation. How about moving the inner view without animation?

The only choice is setContentOffset with animated: false. For example

scrollview.setContentOffset({x: 200, y: 100}, { animated: false });

Now, if you tried this method and does not work for you. The following may help

1. Make sure you call this method after
2. Also, only call the method after you added ScrollView to the Window

var win = Titanium.UI.createWindow();
var scrollview = = Ti.UI.createScrollView();
scrollview.setContentOffset({x: 200, y: 100}, { animated: false });


Popular posts from this blog

FFMPEG - Creating timelapse with FFMPEG with JPEG

MP4 File Format Part 1