为什么我的钛合金应用程序在 iphone 中运行良好却进入无限循环?
我正在钛合金上启动,我成功创建了一个应用程序,或者我是这么认为的......
我在 iPhone 中启动了应用程序,代码运行良好,没有任何问题。
但是当我在 android 中部署应用程序时,我的应用程序将进入创建窗口的无限循环。
所有代码都工作正常,直到我使用这段代码创建一个新的选项卡窗口。
var win=Ti.UI.currentWindow;
win.backgroundImage='goldmenubackground.jpg';
var win_zipsearch=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_search=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_fav=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_morerest=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var tabgroup1=Ti.UI.createTabGroup();
var tab_nearby=Ti.UI.createTab({title:'Near By',window:win});
var tab_zipsearch=Ti.UI.createTab({title:'Zip Search',window:win_zipsearch});
var tab_search=Ti.UI.createTab({title:'Search',window:win_search});
var tab_fav=Ti.UI.createTab({title:'My Favourites',window:win_fav});
var tab_morerest=Ti.UI.createTab({title:'More Restaurants',window:win_morerest});
tabgroup1.addTab(tab_nearby);
tabgroup1.addTab(tab_zipsearch);
tabgroup1.addTab(tab_search);
tabgroup1.addTab(tab_fav);
tabgroup1.addTab(tab_morerest);
tabgroup1.open();
我的目标是创建一个选项卡组窗口 它正在创建一个带有选项卡的窗口创建循环。
我必须卸载该应用程序才能停止它的创作循环。
请帮助
我在代码中找不到任何错误......
仅供参考:我创建了一些其他示例窗口,它们工作正常。
i'm starting up in titanium and i successfully created an app, or i thought so....
i launched application in iphone and the code is working fine with no issues.
but wen i deployed the appin android my application is going into infinite loop of creating windows.
all the code works fine until i used this piece of code in creating a new window of tabs..
var win=Ti.UI.currentWindow;
win.backgroundImage='goldmenubackground.jpg';
var win_zipsearch=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_search=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_fav=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var win_morerest=Ti.UI.createWindow({backgroundImage:'goldmenubackground.jpg'});
var tabgroup1=Ti.UI.createTabGroup();
var tab_nearby=Ti.UI.createTab({title:'Near By',window:win});
var tab_zipsearch=Ti.UI.createTab({title:'Zip Search',window:win_zipsearch});
var tab_search=Ti.UI.createTab({title:'Search',window:win_search});
var tab_fav=Ti.UI.createTab({title:'My Favourites',window:win_fav});
var tab_morerest=Ti.UI.createTab({title:'More Restaurants',window:win_morerest});
tabgroup1.addTab(tab_nearby);
tabgroup1.addTab(tab_zipsearch);
tabgroup1.addTab(tab_search);
tabgroup1.addTab(tab_fav);
tabgroup1.addTab(tab_morerest);
tabgroup1.open();
my aim was to create a window of tabgroup
insted it is creating a loop of window creation with tabs in it.
i have to uninstall the app to stop it's loop of creations.
please help
i cant find any error in the code .......
FYI: i created some other sample windows and they are working fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你不能将当前的Window,
win
按原样粘贴到TabGroup 中。还需要查看更多调用此 .js 文件的代码以查明确切的问题;但我认为这是你问题的开始
you cant take your currentWindow,
win
and stick it in the TabGroup the way you are.also would need to see more of the code that is calling this .js file to pinpoint the exact problem; but I think that is the start of your problem