-1

How do I add UISplitView after clicking on the SingleView application? Clearly when the user has successfully logged in then they will see splitView? How is it possible? Please give me guidelines or if possible then code for that because I'm new to iPhone development and I haven't more knowledge for it?

ThomasW
  • 16,981
  • 4
  • 79
  • 106
sai-info.iphone
  • 75
  • 1
  • 1
  • 9

1 Answers1

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

This is how we have to add splitview controler you have to check the condition weather you are logged in or not and then call this in a method

Rama Rao
  • 1,043
  • 5
  • 22
  • thank's lot its useful for me and tell me one thing that "i add splitview in just write method [self.view addSubview:self.spliteview.view]; so whats the deferent's is there ? – sai-info.iphone Mar 14 '12 at 07:54