开发者

appcelerator titanium - edit button in tabgroup doesn't go away

开发者 https://www.devze.com 2023-04-07 10:18 出处:网络
Using Titanium mobile sdk 1.7.2, I created a tabgroup with 11 tabs. The problem is when I open any of the tabs inside the \'more\' tab, if the child window has a right navbar button, some times the \'

Using Titanium mobile sdk 1.7.2, I created a tabgroup with 11 tabs. The problem is when I open any of the tabs inside the 'more' tab, if the child window has a right navbar button, some times the 'edit' button of the 'more' tab doesn't go away..

my code is:

app.js:

var tabGroup=Titanium.UI.createTabGroup({top:20});
............
/** list of windows and tabs **/
............
var win9 = Titanium.UI.createWindow({ 
    url:'discover.js',
    title:'Discover',
    navBarHidden:true,
    barColor: navBarColor
});
var tab9 = Titanium.UI.createTab({  
    开发者_如何学运维icon:'images/icons/Discover.png',
    title:'Discover',
    window:win9
});

discover.js:

win=Titanium.UI.currentWindow;
var btn=Titanium.UI.createButton({title:'Discover'});
btn.addEventListener('click',function (){
    //do some stuff
});
win.rightNavButton=btn;

the problem is, sometimes when I open the 'tab9' which opens 'win9' my button (btn) doesn't appear, the 'edit' button of the 'more' is shown instead.

N.B: the click event listener works just fine, It is the 'edit' title that persists. Any one knows how to solve this?

thank you,


You need to set allowUserCustomization:false in your Tabgroup.

var tabGroup=Titanium.UI.createTabGroup({top:20,allowUserCustomization:false});


try to set

win.rightNavButton = null;
win.rightNavButton = btn;
0

精彩评论

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

关注公众号