I\'m trying to load a UIViewController in iPad with Form Sheet presentation. The problem is the size of this new view, i put the size values in the IBuilder but the modal view t
I solved it like @Stuart Campbell and @Viruss mca.
Edited
After @Erich's comment, I rewrote it to run in iOS 8 too. Below is the code:
HelpViewController * viewController = [[[HelpViewController alloc] init]];
viewController.modalPresentationStyle=UIModalPresentationFormSheet;
[self presentViewController:viewController animated:YES completion:nil];
--
//HelpViewController.m
- (void) viewWillLayoutSubviews{
[super viewWillLayoutSubviews];
if (!didLayout) {
[self layout];
didLayout = YES;
}
}
- (void) layout{
self.view.superview.backgroundColor = [UIColor clearColor];
CGRect screen = self.view.superview.bounds;
CGRect frame = CGRectMake(0, 0, , );
float x = (screen.size.width - frame.size.width)*.5f;
float y = (screen.size.height - frame.size.height)*.5f;
frame = CGRectMake(x, y, frame.size.width, frame.size.height);
self.view.frame = frame;
}