Combining styling in one label?
I'm creating a label but want to combine bold and normal font face in the same label. Is this possible? If so, how?
2 Answers
-
Currently this is not possible to do in the same label, like you might in HTML/CSS, simply because of the way text labels are implemented in the native SDKs. You would need to string together individual labels styled in the way you would need. We're looking into ways to do inline styling differently for this and hyperlinked text.
-
I see that the "layout" property of Titanium.UI.View is currently undocumented, but there's an example of Horizontal Layout in the KitchenSink demo app. Seems to be the best way to do this currently.
var view = Ti.UI.createView({ height:300, width:320, layout:'horizontal' }); win.add(view); var l1 = Ti.UI.createLabel({ text:'I am the first label', left:5, width:'auto', height:20, }); view.add(l1); var l2 = Ti.UI.createLabel({ text:'I am the second label', left:2, width:'auto', height:20 }); view.add(l2); var l3 = Ti.UI.createLabel({ text:'I am the third label', left:2, width:'auto', height:20 }); view.add(l3);