【问题标题】:SplitViewController with TabbarController带有 TabbarController 的 SplitViewController
【发布时间】:2012-03-13 08:27:12
【问题描述】:

我在我的应用程序中使用拆分视图功能。我必须将标签栏放在 rootViewController 中。

但是当我在标签栏中添加控制器并将它们添加到拆分视图时它不会拆分。

它只显示detailViewController。

这是应用程序中的代码确实完成了启动:

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    UIViewController  *viewController2,*viewController3,*viewController4;
    rootViewController = [[[CategoryItemsList alloc] init] autorelease];
    viewController2 = [[[SearchList alloc] init] autorelease];
    viewController3 = [[[FavoritesList alloc] init] autorelease];

    viewController4 = [[[Information alloc] init] autorelease];

    self.tabBarController = [[[UITabBarController alloc] init] autorelease];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:  rootViewController,viewController2,viewController3,viewController4, nil];

    splitDetail = [[splitDetailView alloc] initWithNibName:@"splitDetailView" bundle:nil];

    UINavigationController *nav=[[UINavigationController alloc] initWithRootViewController:tabBarController];

    splitViewController = [[UISplitViewController alloc] init];
    // splitViewController.tabBarItem = controller.tabBarItem;
    splitViewController.viewControllers = [NSArray arrayWithObjects:nav, splitDetail, nil];
    splitViewController.delegate=splitDetail;
    rootViewController.splitView=splitDetail;
}

【问题讨论】:

标签: objective-c cocoa-touch ipad


【解决方案1】:

您可以参考此链接。我认为这就是您要寻找的:

https://github.com/mattgemmell/MGSplitViewController

http://www.raywenderlich.com/1040/ipad-for-iphone-developers-101-uisplitview-tutorial

http://mikebluestein.wordpress.com/2010/04/03/using-a-uisplitviewcontroller-to-create-a-master-detail-ipad-app-with-monotouch/

添加拆分视图后,只需将 SplitViewController 的对象添加到 TabBarController 作为视图控制器之一

希望这会有所帮助。

【讨论】:

    猜你喜欢
    • 2011-12-18
    • 1970-01-01
    • 2014-01-25
    • 2016-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-25
    相关资源
    最近更新 更多