Created
May 6, 2015 13:57
-
-
Save ardiwine/aa84285c3872a177ee68 to your computer and use it in GitHub Desktop.
Image container to fit in the view port appropriately
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 imageContainer = Ti.UI.createView({ | |
left: 0, | |
right: 0, | |
height: 155, // define the height of each image "row" | |
clipMode: OS_IOS ? Ti.UI.iOS.CLIP_MODE_ENABLED : null, // iOS specific clipMode property that needs to be enabled | |
backgroundColor: '#FFFFFF' | |
}); | |
imageContainer.add(Ti.UI.createImageView({ | |
image: utilities.getFirstImage(args.news.description), | |
width: Ti.UI.SIZE, | |
height: 0.5 * Alloy.Globals.screenHeight // Alloy.Globals.screenHeight is the screen height of the device. I set this one globally. | |
})); | |
$.row.add(imageContainer); // $.row is the table row where you want your image in |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment