views:

1165

answers:

1

Hello,

I have heard that you can make a view popup like in the Mail app for iPad by using modalPresentationStyle. Im having a hard time figuring out how to use it though. I looked a this post here and still couldn't figure out how to do this task. If anyone could explain how to hook up the controllers to make this code work that would be great.

Thanks

+2  A: 

I think the magic incantation is the following:

myViewController = ..... create your new controller if needed ....
myViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
myViewController.modalPresentationStyle = UIModalPresentationFormSheet;
// "self" here is a ViewController instance
[self presentModalViewController:myViewController animated:YES]

I seem to recall that in portrait the modal takes over the screen; in landscape it will be presented centered in the view.

wkw
Okay never mind figured it out. Again, Thanks so much. And just thinking about this now how might you "dismiss" it?
happyCoding25
Figured out how to dismiss [someViewController dismissModalViewControllerAnimated:YES];
happyCoding25