开发者

How to set a tabbarcontroller as rootview controller of UISplitViewController

开发者 https://www.devze.com 2023-01-31 02:27 出处:网络
my application needs the design similar to sybase ipad app which is here YouTube - Sybase Mobile Sales for SAP CRM on iPad

my application needs the design similar to sybase ipad app which is here YouTube - Sybase Mobile Sales for SAP CRM on iPad

  1. 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]];
  1. 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.


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.

How to set a tabbarcontroller as rootview controller of UISplitViewController

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.


if I'm not mistaken, UITabBarController should always be the root view controller in all cases. So you're going the opposite way.

0

精彩评论

暂无评论...
验证码 换一张
取 消