Skip to content

Instantly share code, notes, and snippets.

@hansemannn
Created July 1, 2016 23:38
Show Gist options
  • Save hansemannn/2865ee2f8405797666975e8093fa0e3b to your computer and use it in GitHub Desktop.
Save hansemannn/2865ee2f8405797666975e8093fa0e3b to your computer and use it in GitHub Desktop.
var win = Ti.UI.createWindow({
backgroundColor : "#fff",
layout: "vertical"
});
// Existing text styles (>= iOS 7)
win.add(createLabel("Headline", Ti.UI.TEXT_STYLE_HEADLINE));
win.add(createLabel("Subheadline", Ti.UI.TEXT_STYLE_SUBHEADLINE));
win.add(createLabel("Body", Ti.UI.TEXT_STYLE_BODY));
win.add(createLabel("Footnote", Ti.UI.TEXT_STYLE_FOOTNOTE));
win.add(createLabel("Caption 1", Ti.UI.TEXT_STYLE_CAPTION1));
win.add(createLabel("Caption 2", Ti.UI.TEXT_STYLE_CAPTION2));
// New text styles (>= iOS 9)
win.add(createLabel("Callout", Ti.UI.TEXT_STYLE_CALLOUT));
win.add(createLabel("Title 1", Ti.UI.TEXT_STYLE_TITLE1));
win.add(createLabel("Title 2", Ti.UI.TEXT_STYLE_TITLE2));
win.add(createLabel("Title 3", Ti.UI.TEXT_STYLE_TITLE3));
win.open();
function createLabel(text, textStyle) {
return Ti.UI.createLabel({
top: 20,
left: 20,
font: {
textStyle: textStyle
},
text: text
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment