我正在使用这款演示钛金属应用程序获得过渡黑屏闪光。要查看flash,请将此代码加载为app.js并执行以下操作: 1)单击第一个按钮以进入选项卡组 2)单击第二个按钮返回导航组并关闭/删除选项卡组 3)再次单击第一个按钮...它应该像第一次点击一样顺利过渡?它不会,它会在第二次转换到制表组时闪烁黑屏。
//create homepage window
var homepagewindow = Titanium.UI.createWindow({ title: 'homepage', backgroundColor:'white', navBarHidden:true });
//create button for homepage window
var intotabs = Titanium.UI.createButton({title:'go into tabs',width:200,height:50});
homepagewindow.add(intotabs);
//setup tab windows
var window1 = Ti.UI.createWindow({backgroundColor:'yellow',navBarHidden:true});
var backtonav = Titanium.UI.createButton({title:'go back to nave',width:200,height:50});
window1.add(backtonav);
var window2 = Ti.UI.createWindow({backgroundColor:'red',navBarHidden:true});
var window3 = Ti.UI.createWindow({backgroundColor:'blue',navBarHidden:true});
//Set up the Nav Group and assign the first window
var navGroup = Ti.UI.iPhone.createNavigationGroup({
window:homepagewindow
});
//Set up the Tab Group
var tabGroup = Titanium.UI.createTabGroup();
//Set up the Tabs and assign their windows
var tab = Titanium.UI.createTab({
icon:'images/tabs/KS_nav_ui.png',
title:'Tab1',
window: window1
});
var tab2 = Titanium.UI.createTab({
icon:'images/tabs/KS_nav_ui.png',
title:'Tab2',
window: window2
});
var tab3 = Titanium.UI.createTab({
icon:'images/tabs/KS_nav_ui.png',
title:'Tab3',
window: window3
});
//add the tabs to the tab group
tabGroup.addTab(tab);
tabGroup.addTab(tab2);
tabGroup.addTab(tab3);
//This is the main window of the application
var main = Ti.UI.createWindow({navBarHidden:true});
main.add(navGroup);
main.open();
//functions
intotabs.addEventListener('click', function() {
main.add(tabGroup);
tabGroup.open({
transition: Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
});
main.remove(navGroup);
});
backtonav.addEventListener('click', function() {
main.add(navGroup);
tabGroup.close({
transition: Titanium.UI.iPhone.AnimationStyle.FLIP_FROM_LEFT
});
main.remove(tabGroup);
});