I'm currently building a custom keyboard for iOS 8 though extensions. When the user presses a certain button on the keyboard view, I want to present a full screen modal view controller. When I try to present the view controller, it tries to present within the bounds of the keyboard view. I'm using [self presentViewController:animated:completion:]
with an instantiated view controller. Is there anyway to present a full screen view controller? akin to photo editing extensions(which display a full screen view controller)
Thank you
Press Ctrl + Drag your UIView to Safe Area, choose Equal Height and do the same for the Width. Save this answer.
Present ViewController in full screen To prevent this, the presentation style can be changed. To present the DetailViewController full screen, the modalPresentationStyle property of a view controller must be set to . fullScreen before it will be presented.
You should Increase height of your keyboard and then present your View Controller. Try something like this:
- (void) presentVC{
NSLayoutConstraint *_heightConstraint = [NSLayoutConstraint constraintWithItem:self.view
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:[UIScreen mainScreen].bounds.size.height];
[self.view addConstraint: _heightConstraint];
TestViewController *test = [[TestViewController alloc] initWithNibName:@"TestViewController" bundle:nil];
[self presentViewController:test animated:YES completion:^{
}];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With