我是新的,我看到類似的問題,但很老,沒有解決方案。我想要的只是在activeTab中打開新窗口並保留選項卡組。不幸的是,我的代碼打開新窗口,但不保留標籤,窗口只是全屏。 如果有人能確認我想達到的目標是否可能,我將不勝感激。也許以某種方式意見...再一次它應該爲Android工作。以下是代碼:(鈦手機,Android)activeTab.open()新窗口不保留標籤
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
// create tab group
var tabGroup = Titanium.UI.createTabGroup();
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff'
});
var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
//
// create controls tab and root window
//
var win2 = Titanium.UI.createWindow({
title:'Tab 2',
backgroundColor:'#fff'
});
var tab2 = Titanium.UI.createTab({
icon:'KS_nav_ui.png',
title:'Tab 2',
window:win2
});
var label2 = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 2',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto'
});
win2.add(label2);
var data = [
{title:"Sample 1",color:'black',hasChild:true,font:{fontSize:16,fontWeight:'bold'}},
{title:"Sample 2",color:'black',hasChild:true,font:{fontSize:16,fontWeight:'bold'}}
];
var table = Titanium.UI.createTableView({
data:data,
separatorColor: '#ccc',
backgroundColor:'#fff'
});
win1.add(table);
// create table view event listener
table.addEventListener('click', function(e)
{
var win = Titanium.UI.createWindow({
url:'windows/main.js'
});
// this simply opens the new created window but full screen and without original tab group.
tabGroup.activeTab.open(win,{animated:true});
});
//
// add tabs
//
tabGroup.addTab(tab1);
tabGroup.addTab(tab2);
// open tab group
tabGroup.open();
問題是針對Android,而不是iPhone。 Android沒有導航組 –