Feature
Enable setZoomScale:animated: so scrollView can be animated.
setZoomScale:animated:
A floating-point value that specifies the current zoom scale.
- (void)setZoomScale:(float)scale animated:(BOOL)animated
Apple release docs
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIScrollView_Class/Reference/UIScrollView.html
The case: zoomScale property cannot be animated on scrollview
var win = Ti.UI.createWindow();
var scroll = Ti.UI.createScrollView({
top: 0,
bottom: 0,
left: 0,
right: 0,
maxZoomScale: 5,
minZoomScale: 1
});
win.add(scroll);
var img = Ti.UI.createImageView({
width: 320,
height: 320,
image: 'http://www.ryanboden.com/wp-content/uploads/2011/07/jay-z-and-kanye-west-watch-the-throne.jpg',
defaultImage: 'none',
hires: true,
});
img.addEventListener('doubletap', function(e){
scroll.animate({
zoomScale: 1,
duration: 300
});
//zoomScale only works on setZoomScale
//which has the animated parameter to perform the animation
//scroll.setZoomScale( 1, { animated: true} );
});
scroll.add(img);
win.open();
PR merged https://github.com/appcelerator/titanium_mobile/pull/2818
Closing issue. Verified on: OS: Mac OS X Lion 10.7.4 Titanium Studio, build: 3.0.0.201210090117 Titanium SDK, build: 3.0.0.v20121015133920 Device: iPhone 4S (4.3.5)