Created
April 16, 2015 07:52
-
-
Save rajubd49/0fa8ecb156d480a5c802 to your computer and use it in GitHub Desktop.
Actual Size of an element - Appcelerator Titanium
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 win = Ti.UI.createWindow(); | |
var view=Ti.UI.createView({ | |
width:Ti.UI.SIZE, | |
height:Ti.UI.SIZE, | |
backgroundColor:'#fff' | |
}); | |
win.addEventListener('open', function(){ | |
Ti.API.info('View Width:'+view.size.width + ', View Height:' + view.size.height); | |
}); | |
var lbl= Ti.UI.createLabel({ | |
width:Ti.UI.SIZE, | |
height:Ti.UI.SIZE, | |
text:'Appcelerator Titanium' | |
}); | |
win.addEventListener('postlayout', function(){ | |
Ti.API.info('Label Width:' + lbl.rect.width + ', Label Height:' + lbl.rect.height); | |
}); | |
win.add(view); | |
view.add(lbl); | |
win.open(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment