Created
February 7, 2012 01:08
-
-
Save naotokui/1756346 to your computer and use it in GitHub Desktop.
- (void) presentModalViewControllerInSizeYouWant (for iPad)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) presentModalViewControllerInSizeYouWant | |
{ | |
float width = <width you wnat>; | |
float height = <height you wnat>; | |
UIViewController *viewCtl = [[UIViewController alloc] initWithNibName: @"UIViewController" bundle: nil]; | |
viewCtl.modalPresentationStyle = UIModalPresentationFormSheet; // set presentation style | |
[self presentModalViewController:viewCtl animated: YES]; // show! | |
// Just after presenting the view, customize it now! | |
viewCtl.view.superview.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin; | |
viewCtl.view.superview.frame = CGRectMake(viewCtl.view.superview.frame.origin.x, viewCtl.view.superview.frame.origin.y, | |
width, height); | |
viewCtl.view.superview.center = self.view.center; | |
[viewCtl release]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment