1
votes

I have splitview and it contains rootviewcontroller(uitableviewcontroller subclass) and detailview(viewcontroller subclass). Now I have the code like this in rootview(tableviewcontroller subclass).

- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

if (delegate != nil) {
    [delegate viewchange];
}

}

and in detailviewcontroller(viewcontroller subclass at right side).

-(void)viewchange{

nextviewcontroller *nextView = [[nextviewcontroller alloc] initWithNibName:@"nextviewcontroller" bundle:nil];

[nextView.view setFrame:self.view.bounds];
[nextView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self presentModalViewController:nextView animated:YES];

[nextView release];

}

and navigation happens successfully by selecting the row in rootview but that nextview appears in whole screen that will hide rootview controller's view(tableview) So HOW can I show rootview on left side and navigatation only in right side whithin the size of detailview?

thanx for any help.

2

2 Answers

1
votes

I am not sure whether my answer is the correct answer but I will try...

I see that you use "presentModalViewController" to bring in the view... according to the documentation in this,click here it says that

the view of the modal view controller is always presented in full screen

so I guess that is why your view is coming in the full screen. If you want to use Modal view controller, it says that for the Ipad you can change the presentation type using modalPresentationStyle property which can be accessed from this link modalPresentationStyle.

Have a look and see if it helps you.

Also, if you have found the answer to your question, please do post it so that it will help others who come across your question.

0
votes

I have the same problem

full screen problem eliminated but frame of that new view is on middle so i will try more later

can you post your code? i try to set the frame but nothing happen:

    -(void)showFlipView
{
    UIViewController *controller = [[UIViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    //controller.delegate = self;
    controller.modalPresentationStyle = UIModalPresentationCurrentContext;
    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [controller.view setFrame:self.view.bounds];
    /*controller.view.frame = CGRectMake(300.0, 
                                       0.0, 
                                       self.readerDetailView.frame.size.width, 
                                       self.readerDetailView.frame.size.height);
    */
    [self presentModalViewController:controller animated:YES];

    [controller release];
}

EDIT: Solved! i must set the frame AFTER the animation:

    UIViewController *controller = [[UIViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
//controller.delegate = self;
controller.modalPresentationStyle = UIModalPresentationCurrentContext;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];
controller.view.frame = CGRectMake(self.readerDetailView.frame.origin.x, 
                                   self.readerDetailView.frame.origin.y, 
                                   self.readerDetailView.frame.size.width, 
                                   self.readerDetailView.frame.size.height);
[controller release];