Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/103.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 基于方向以编程方式更改拆分视图_Ios_Objective C_Uisplitviewcontroller - Fatal编程技术网

Ios 基于方向以编程方式更改拆分视图

Ios 基于方向以编程方式更改拆分视图,ios,objective-c,uisplitviewcontroller,Ios,Objective C,Uisplitviewcontroller,我意识到Apple文档建议将拆分视图设置为根视图控制器。所以本质上我有一个带有标签栏的应用程序。在选项卡栏的第一个索引内,我有一个拆分视图。当设备的方向为纵向时,我希望(分割的主细节)填充整个屏幕或成为详细页面,但更重要的是,当设备为纵向时,我没有选择具有主细节。因此,我的想法是根据设备的方向交换选项卡栏索引。我的代码是这样的: -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientati

我意识到Apple文档建议将拆分视图设置为根视图控制器。所以本质上我有一个带有标签栏的应用程序。在选项卡栏的第一个索引内,我有一个拆分视图。当设备的方向为纵向时,我希望(分割的主细节)填充整个屏幕或成为详细页面,但更重要的是,当设备为纵向时,我没有选择具有主细节。因此,我的想法是根据设备的方向交换选项卡栏索引。我的代码是这样的:

-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
        if( UIInterfaceOrientationIsLandscape(toInterfaceOrientation) )
    {

       UISplitViewController * splitview = [[UISplitViewController alloc]init];
//        
//        splitview.delegate =self;
//        [splitview willRotateToInterfaceOrientation:self.interfaceOrientation duration:0];






        NSLog(@"LandScape!!");

        NSMutableArray * array = [MyCustomwViewManager changeHomeOrientationTolandScape:[NSMutableArray arrayWithArray:self.tabBarController.viewControllers] viewController:self navigationController:self.navigationController splitView:splitview];

     [self.tabBarController setViewControllers:array animated:YES];

        // [self viewDidLoad];

    } else {

        NSMutableArray * changeSplit = [NSMutableArray arrayWithArray: self.splitViewController.viewControllers];


        NSMutableArray * array = [MyCustomViewManager changeHomeOrientationToPortrait:[NSMutableArray arrayWithArray:self.tabBarController.viewControllers] viewController:[changeSplit objectAtIndex:0] navigation:[changeSplit objectAtIndex:0]];


           [self.tabBarController setViewControllers:array animated:YES];


    }



}
我的目标是实现类似于yelp iPad应用程序的功能。希望我是清楚和有意义的