Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked June 8th 2010 by Surojit Niyogi
  • label
0 Comments

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.

    — answered June 8th 2010 by Kevin Whinnery
    permalink
    2 Comments
    • How would you concatenate labels so that the flow after one another seamlessly?

      — commented June 8th 2010 by Surojit Niyogi
    • has this been resolved yet? or even TBS ?

      — commented February 18th 2011 by Alberto Marcone
  • 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);
    
    — answered June 13th 2010 by Rob Marscher
    permalink
    1 Comment
    • does not work in Android, unfortunately

      — commented June 30th 2010 by Jicks Steen
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.