TabBar(UITabBarController)中的UISplitViewController? [英] UISplitViewController in a TabBar ( UITabBarController )?

查看:90
本文介绍了TabBar(UITabBarController)中的UISplitViewController?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我处于一种情况,我需要从基于选项卡的应用程序开始,并且我需要一个或多个选项卡的拆分视图。但似乎拆分视图控制器对象无法添加到tabbarController。 (虽然可以将tabbar对象添加到splitviewcontroller中。)

I am in kind of situation that I need to start with a tab based application and in that I need a split view for one or more tabs. But it seems that split view controller object can not be added to the tabbarController. (Although tabbar object can be added to the splitviewcontroller).

其他问题可以看出:我在左边部分有一个全屏我有一个表视图在表中选择一个行,弹出框应该指向该行。现在,当弹出窗口中的任何行被选中时,此弹出窗口中的行将位于所选行的左下方(仅此行可见),而另一个弹出窗口将从所选行中出现。 (面包屑导航类型)

The problem can be seen otherways: I have a full screen in the left part I have a table view when any row is selected in the table a popover should come out pointing that row. Now when any row in the popover is selected the rows in this popover comes to the left under the selected row (only this row would be visible) and another popover comes out from the selected row. (Breadcrumb navigation type)

我想我清楚地解释了什么。那么有任何想法或解决方法吗?

I think I am clear in what I explained. So guys any ideas or work arounds?

如果我不清楚我的问题,请告诉我。

Please let me know if I am not clear in my question.

谢谢,

Madhup

推荐答案

我做了一个示例应用程序。并发现我们可以通过编程方式执行以下操作:

I made a sample application. and found we can do it programmatically like:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

        NSMutableArray *array = [NSMutableArray array];

        NSMutableArray *tabArray = [NSMutableArray array]; 

        UISplitViewController *splitViewConntroller = [[UISplitViewController alloc] init];

        MainViewController *viewCont = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
        [array addObject:viewCont];
        [viewCont release];

        viewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
        [array addObject:viewCont];
        [viewCont release];




        [splitViewConntroller setViewControllers:array];

        [tabArray addObject:splitViewConntroller];

        [splitViewConntroller release];

        array = [NSMutableArray array];

        splitViewConntroller = [[UISplitViewController alloc] init];

        viewCont = [[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil];
        [array addObject:viewCont];
        [viewCont release];

        viewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
        [array addObject:viewCont];
        [viewCont release];

        [splitViewConntroller setViewControllers:array];

        [tabArray addObject:splitViewConntroller];

        [splitViewConntroller release];

        // Add the tab bar controller's current view as a subview of the window
        [tabBarController setViewControllers:tabArray];

        [window addSubview:tabBarController.view];
        [window makeKeyAndVisible];

        return YES;
    }

希望这有帮助。

这篇关于TabBar(UITabBarController)中的UISplitViewController?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆