понедельник, 23 июля 2012 г.

Change frame size for modal controller with modalPresentationStyle = UIModalPresentationFormSheet

ARC version
ModalViewController *targetController = [[ModalViewController alloc] init];
targetController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:targetController animated:YES];
targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after presentModalViewController
targetController.view.superview.center = self.view.center;//self.view assumes the base view is doing the launching, if not you might need self.view.superview.center etc.
None ARC
ModalViewController *targetController = [[[ModalViewController alloc] init] autorelease];
targetController.modalPresentationStyle = UIModalPresentationFormSheet;
[self presentModalViewController:targetController animated:YES];
targetController.view.superview.frame = CGRectMake(0, 0, 200, 200);//it's important to do this after presentModalViewController
targetController.view.superview.center = self.view.center;//self.view assumes the base view is doing the launching, if not you might need self.view.superview.center etc.
see on stackoverflow.com

Комментариев нет:

Отправить комментарий