背景图像问题与我的后退按钮

时间:2011-04-29 10:03:07

标签: iphone button background-image appcelerator

我担心我后面的图像按钮没有出现我添加了这个声明,但它没有做任何事情

win1.setBackButtonTitleImage('back.png');

这是代码

 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');

你对这个问题有所了解

谢谢

我找到了解决方案

我实际上使用以下

更改了创建后退按钮的代码
var backButton = Ti.UI.createButton({
    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;

1 个答案:

答案 0 :(得分:0)

试试吧。请注意,我不确定您是否可以同时使用backgroundColorbackgroundImage

    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;
相关问题