如何将 tabGroup 添加到 iPad 版 Titanium 中的 SplitWindow
目前,我正在用钛为 iPad 构建一个应用程序。我想将 tabGroup 添加到 splitWindow,但我似乎无法让它工作。选项卡永远不会显示,我不知道我做错了什么。
我正在使用 docs:
var win = Ti.UI.createWindow();
var nav = Ti.UI.iPhone.createNavigationGroup({
window: win
});
var masterView = Ti.UI.createWindow();
var tabwin = Ti.UI.createWindow({backgroundColor: '#FFF'});
var tabs = Ti.UI.createTabGroup();
var tab = Ti.UI.createTab({
window: tabwin,
title: 'Tab'
});
tabs.addTab(tab);
masterView.add(tabs);
tabs.show();
var splitwin = Ti.UI.iPad.createSplitWindow({
detailView:nav,
masterView:masterView
});
splitwin.addEventListener('visible',function(e)
{
if (e.view == 'detail')
{
e.button.title = "Master";
win.leftNavButton = e.button;
}
else if (e.view == 'master')
{
win.leftNavButton = null;
}
});
var tabwindow = Ti.UI.createWindow({
title: 'Master',
backgroundColor: '#FFF',
navBarHidden: false
});
splitwin.open();
masterView
我更改为 tabGroup (在模拟器中运行后不再显示任何内容。当我尝试将 tabGroup 添加到 MasterView 时,分屏确实显示窗口, 但不显示 tabGroup。
我现在的问题是,如何向 SplitWindow 添加选项卡或选项卡组?
Currently, I am building an application for the iPad with titanium. I want to add a tabGroup to a splitWindow, But I just can't seem to get it working. The tabs never show, and I have no clue what I'm doing wrong.
I am using the dummy code from the docs:
var win = Ti.UI.createWindow();
var nav = Ti.UI.iPhone.createNavigationGroup({
window: win
});
var masterView = Ti.UI.createWindow();
var tabwin = Ti.UI.createWindow({backgroundColor: '#FFF'});
var tabs = Ti.UI.createTabGroup();
var tab = Ti.UI.createTab({
window: tabwin,
title: 'Tab'
});
tabs.addTab(tab);
masterView.add(tabs);
tabs.show();
var splitwin = Ti.UI.iPad.createSplitWindow({
detailView:nav,
masterView:masterView
});
splitwin.addEventListener('visible',function(e)
{
if (e.view == 'detail')
{
e.button.title = "Master";
win.leftNavButton = e.button;
}
else if (e.view == 'master')
{
win.leftNavButton = null;
}
});
var tabwindow = Ti.UI.createWindow({
title: 'Master',
backgroundColor: '#FFF',
navBarHidden: false
});
splitwin.open();
The masterView
i changed to a tabGroup (which doesn't show a thing anymore after I run it in simulator. When I try to add a tabGroup to the MasterView, the splitscreen does show the window, but doesn't show the tabGroup.
My question now is, how do I add tabs or a tabgroup to the SplitWindow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需在您的代码中执行此操作:
Just do this in your code: