如何将 tabbarcontroller 设置为 UISplitViewController 的根视图控制器
我的应用程序需要类似于 sybase ipad 应用程序的设计,该应用程序位于 YouTube - iPad 上的 Sybase Mobile Sales for SAP CRM
- 如何将 tabbarcontroller 设置为 UISplitViewController 的 rootview 控制器。
当我尝试执行此操作时,会显示 8 个选项卡项目,但没有“更多”按钮。所以它的重叠项目标题。如果选项卡项超过 8 个,则会显示更多按钮。
由于它使用宽度 320,如何设置一次仅显示 5 个选项卡。
示例
array = [[NSMutableArray alloc] init ];
for(int i=0; i <10; i++){
TestTabController *cc = [[TestTabController alloc]init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:cc] ;
[cc release];
[array addObject:navController];
[alertNavController release];
}
mytabBarController = [[UITabBarController alloc] init];
mytabBarController.viewControllers = array;
splitViewConntroller = [[UISplitViewController alloc] init];
[splitViewConntroller setViewControllers:[NSArray arrayWithObjects:mytabBarController, detailNavigationController, nil]];
- 如何在运行时将DetailController 视图设置为 tabbarcontrolller(rootController) 中的控制器 - 有简单的方法吗?- ..我们可以看到,当用户点击detailController视图中的单元格时,它会立即移动到rootController,并且其详细信息将显示在detailController中
。任何帮助/评论/建议将不胜感激。
my application needs the design similar to sybase ipad app which is here YouTube - Sybase Mobile Sales for SAP CRM on iPad
- How can I set a tabbarcontroller as rootview controller of UISplitViewController.
When I try to do this, 8 tabitems are displaying without "More" button. so its overlapping items title. And it will display More button if more than 8 tab items.
As it is using width 320, How to set only 5 tabs visible at a time.
sample
array = [[NSMutableArray alloc] init ];
for(int i=0; i <10; i++){
TestTabController *cc = [[TestTabController alloc]init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:cc] ;
[cc release];
[array addObject:navController];
[alertNavController release];
}
mytabBarController = [[UITabBarController alloc] init];
mytabBarController.viewControllers = array;
splitViewConntroller = [[UISplitViewController alloc] init];
[splitViewConntroller setViewControllers:[NSArray arrayWithObjects:mytabBarController, detailNavigationController, nil]];
- How can I set the detailController view as a controller in the tabbarcontrolller(rootController) at runtime -Any easy methods ?-.. We can see when user tap on a cell in the detailController view, it immediatly move to rootController and its detail will show in detailController
Any help/comments/suggestions would be grealy appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您从项目模板创建基于 UISplitViewController 的项目,然后在界面生成器中打开 MainWindow.xib 文件,则只需将选项卡栏控制器组件从库调色板拖到拆分内的第一个视图控制器(导航控制器)即可视图控制器。然后您应该能够开始将视图控制器添加到新的选项卡栏控制器。然后,您只需指定要用于每个选项卡的视图控制器。我已经用这种方式创建了几个项目并且效果很好。
当然,我在这里假设 Xcode 3。如果您使用的是 Xcode 4,我不完全确定它在 Xcode 4 中是否相同。
If you create a UISplitViewController based project from the project templates and then open the MainWindow.xib file in interface builder, you can then just drag a tab bar controller component from the Library palette onto the first view controller (the navigation controller) inside the split view controller. Then you should be able to just start adding view controllers to the new tab bar controller. You then just specify the view controllers you want to use for each of the tabs. I've created several projects this way and it works quite well.
Of course, I'm assuming Xcode 3 here. I'm not completely sure if it's the same in Xcode 4 if that's what you're using.
如果我没有记错的话, UITabBarController 在所有情况下都应该始终是根视图控制器。
所以你要走相反的路。
if I'm not mistaken, UITabBarController should always be the root view controller in all cases.
So you're going the opposite way.