开发者

BackgroundImage problem with my back button

I have a concern that the image I attributed back button does not appear I added this statement but it does nothing

win1.setBackButtonTitleImage('back.png');

here is the code

 var ButtonRetour = Ti.UI.createButtonBar({labels:['Retour'], 
                                           backgroundColor:'#ae4041',  
                                           backgroundImage:'back.png',  
                                           color:'#ffffff' });             
 ButtonRetour.addEventListener('click',
                               function(){    tabGroup.close(); });

 win1.leftNavButton = ButtonRetour;
 win1.setBackButtonTitleImage('back.png');

you have an idea about the problem

thank you

I found the solution

I actually changed the code for the creation of back button using the following

var backButton = Ti.UI.crea开发者_开发知识库teButton({
    title:'Accueil',
    backgroundImage:'images/back.png',
    font:{fontSize:13,fontWeight:'bold'},
    textAlign:'center',
    width:75,
    height: 35       
});             

backButton.addEventListener('click', function(){
    tabGroup.close();
});

win1.leftNavButton = backButton;


Try that. Note, that I am not sure whether you can use both backgroundColor and backgroundImage:

    var ButtonRetour = Titanium.UI.createButton({
                    title:'Retour',
                    backgroundColor: '#ae4041', // i am not sure whether you can use both bgColor and bgImage
        backgroundImage:'back.png',
        width:100, //set proper width here
        height:20  //set proper height here
    });
    ButtonRetour.addEventListener('click', function() {
        tabGroup.close();
    });
    win1.leftNavButton = ButtonRetour;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜