Iphone 带有SingleViewController的UISplitView

Iphone 带有SingleViewController的UISplitView,iphone,objective-c,ios,Iphone,Objective C,Ios,单击SingleView应用程序后如何添加UISplitView?显然,当用户成功登录后,他们将看到splitView?怎么可能呢?请给我一些指导,或者如果可能的话,给我一些代码,因为我对iPhone的开发还不熟悉,所以我没有更多的知识 [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration: 1.90]; [UIView setAnimationTransition:UIViewAnimationT

单击SingleView应用程序后如何添加
UISplitView
?显然,当用户成功登录后,他们将看到splitView?怎么可能呢?请给我一些指导,或者如果可能的话,给我一些代码,因为我对iPhone的开发还不熟悉,所以我没有更多的知识

    [UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration: 1.90];
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:self.navigationController.view cache:YES];

MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil];
if (!masternavigationController) {
    masternavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];

}
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailView" bundle:nil];

if (!splitViewController) {
    splitViewController = [[UISplitViewController alloc] init];
    splitViewController.viewControllers = [NSArray arrayWithObjects:masternavigationController, detailViewController, nil];

    UIViewController *view_controller = (UIViewController *)[navigationController.viewControllers objectAtIndex:([navigationController.viewControllers count]-1)];      
    [masternavigationController.navigationBar setHidden:TRUE];
    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];


    [splitViewController.view setBounds:CGRectMake(0, 0, 1024, 748)];
    [splitViewController.view setTransform:CGAffineTransformMakeRotation(M_PI / 2)]; 
    [view_controller.view setTransform:CGAffineTransformMakeRotation(M_PI / 2)]; 

    view_controller.view.tag = 17;
    [UIView animateWithDuration:1.05 animations:^{navigationController.view.alpha = 0.0;} completion:^(BOOL finished){

        [navigationController.view addSubview:splitViewController.view];

        [UIView animateWithDuration:1.00 animations:^{navigationController.view.alpha = 1.0;} completion:nil];}];
    rootview *rtview = [[rootview alloc] initWithNibName:@"rootview" bundle:nil];
    rtview.delegate = detailViewController;
    [detailViewController.view addSubview:rtview.view];
    flag = YES;
    [rtview release];
}
[UIView commitAnimations];

//  [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(doneAnimation) userInfo:nil repeats:NO];
[masterViewController release];
[detailViewController release];

这就是我们必须添加splitview控制器的方法。您必须检查您是否登录的条件,然后在方法中调用此控件。

我认为它会回答您的问题。感谢您的帮助。它对我很有用,并告诉我一件事:“我在只需编写方法[self.view addSubview:self.spliteview.view]中添加splitview。”;那么有什么区别呢?