Skip to content

Instantly share code, notes, and snippets.

@alanleard
Created August 2, 2012 19:05
Show Gist options
  • Save alanleard/3239793 to your computer and use it in GitHub Desktop.
Save alanleard/3239793 to your computer and use it in GitHub Desktop.
Scroll Image
var lImageView = Ti.UI.createScrollView({
height:labelSize.height,
width:labelSize.width,
contentHeight:'auto',
contentWidth:'auto',
minZoomScale:0.05,
maxZoomScale:5.0,
zoomScale:1.0
});
var view = Ti.UI.createView({
height:labelSize.height,
width:labelSize.width,
});
var iHeight = e.media.height;
var iWidth = e.media.width;
view.add(lImageView);
var iView = Ti.UI.createImageView({
height:iHeight,
width:iWidth,
image:e.media
});
var buffer = Ti.UI.createView({
height:iHeight*3,
width:iWidth*3
});
lImageView.contentOffset = {x:((iWidth*3)/2)-(labelSize.width)/2, y:((iHeight*3)/2)-(labelSize.height)/2}
buffer.add(iView);
lImageView.add(buffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment