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

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

问题描述

我的情况是,我需要从基于选项卡的应用程序开始,并且需要一个或多个选项卡的拆分视图.但是似乎无法将拆分视图控制器对象添加到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.

谢谢,

马杜普

推荐答案

我制作了一个示例应用程序.并发现我们可以通过编程方式做到这一点:

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;
    }

希望这会有所帮助.

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

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