Created
August 2, 2012 19:05
-
-
Save alanleard/3239793 to your computer and use it in GitHub Desktop.
Scroll Image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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