簡體   English   中英

我的后退按鈕的背景圖像問題

[英]BackgroundImage problem with my back button

我擔心沒有出現我歸因於后退按鈕的圖像我添加了此語句,但它什么也沒做

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;

試試看。 請注意,我不確定您是否可以同時使用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;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM