-
-
Save himalay/850cb0bddbb32d0c7abc to your computer and use it in GitHub Desktop.
Who said you can't do padding in Titanium (Alloy)?
This file contains hidden or 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
"#wrapper": { | |
// Set wrapper to adjust it's size to it's contents | |
width: Ti.UI.SIZE, | |
height: Ti.UI.SIZE, | |
// Set stuff like borders and backgrounds on the wrapper | |
backgroundColor: "red" | |
} | |
"#content": { | |
// Set content to anything but the default Ti.UI.FILL | |
// For example a absolute (dp) or relative (%) value | |
// Or again, set to adjust to it's content (the text) | |
width: Ti.UI.SIZE, | |
height: Ti.UI.SIZE, | |
// Set the padding values like so: | |
top: "10dp", right: "10dp", bottom: "10dp", left: "10dp", | |
// Set stuff like color and font on the content | |
color: "white" | |
} |
This file contains hidden or 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
<Alloy> | |
<Window> | |
<!-- Wrap the element you need padding for in another view --> | |
<View id="wrapper"> | |
<Label id="content">Hello, World</Label> | |
</View> | |
</Window> | |
</Alloy> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment