Titanium Community Questions & Answer Archive

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

Option groupd View header and footer

Is there a way to set the font color?

— asked March 15th 2010 by Peter Lum
0 Comments

3 Answers

  • Of course :)

    In a HTML tag :

    <h1 id="title" style="color: blue;">Exemple</h1>

    In your template :

    <style>
    h1 { color: red; }

    </style>

    With JS :

    document.getElementById('idTag').style. color = 'blue';

    @tchaOo°

    — answered March 15th 2010 by Adrien Giboire
    permalink
    0 Comments
  • Something like this should work:

    var headerView = Ti.UI.createView({
        height:60
    });
    
    var headerLabel = Ti.UI.createLabel({
        left:20,
        width:'auto',
        height:'5',
        text:'Title',
        color:'#f4ca40',
        shadowColor:'black',
        shadowOffset:{x:0,y:1},
        font:{fontWeight:'bold',fontSize:10}
    });
    
    headerView.add(headerLabel);
    

    Then in your option group, just add this to it:

    headerView:headerView
    

    Can do the same thing for the footer.

    — answered March 15th 2010 by Dan Giulvezan
    permalink
    0 Comments
  • I can't seem to make it work.. does it work with 0.8.1 SDK?

    code below:
    var headerView = Titanium.UI.createView({
    height:60
    });

            var headerLabel = Titanium.UI.createLabel({
                            text:'Appcelerator',
                            height:'auto',
                            width:'auto',
                            shadowColor:'#aaa',
                            shadowOffset:{x:5,y:5},
                            color:'#900',
                            font:{fontSize:48},
                            textAlign:'center'
                            });
    
    
            headerView.add(headerLabel);            
    
    
    
            var optionData = [
                {image:'option_dawn.png', title:'Dawn', rowHeight:50},
                {image:'option_day.png', title:'Day' , selected:true, rowHeight:50},
                {image:'option_evening.png', title:'Evening', rowHeight:50},
                {image:'option_dusk.png', title:'Dusk', rowHeight:50},
                {image:'option_night.png', title:'Night', rowHeight:50}
            ];
    
    
            var optionSection = Titanium.UI.iPhone.createGroupedSection({
                header:'Background',
                // headerView:headerView,
                type:'option',
                data:optionData
            });
    
    — answered March 15th 2010 by Peter Lum
    permalink
    0 Comments
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.