2012-03-14 48 views
-1

如何在單擊SingleView應用程序後添加UISplitView?顯然,當用戶成功登錄後,他們會看到splitView?這怎麼可能?請給我指導,或者如果可能的話,那麼代碼,因爲我是新手到iPhone開發,我沒有更多的知識呢?UISplitView with SingleViewController

+0

我認爲它會回答你的問題的HTTP調用這個:// stackoverflow.com/questions/2633532/navigate-to-a-splitviewcontroller – 2012-03-14 06:23:41

回答

0
[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 CONTROLER你必須檢查你登錄或沒有條件的天氣,然後在方法

+0

感謝很多它對我有用,並告訴我一件事「我添加splitview在只寫方法[self.view addSubview:self.spliteview.view];所以那裏有什麼傳言? – 2012-03-14 07:54:56