(iOS) don't move up a modal view when the keyboard appears

352 views Asked by At

I have a modal view (form sheet style) and i don't want it to move up when the keyboard appears because i have a popover inside that doesn't follow the modal view and looks really bad.

Basically i want to prevent moving up the modal view when the keyboard shows up

thanks!!

Here the images that show how it looks

enter image description here

enter image description here

EDIT - SOLUTION

Thanks for helping me!!

what i did at the end was to change the style to UIModalPresentationPageSheet and change the superview bounds to look like a form sheet.

self.checkIn = [[ApparatusCheckInViewController alloc] initWithNibName:@"ApparatusCheckInViewController" bundle:[NSBundle mainBundle]];
[self.checkIn setModalPresentationStyle:UIModalPresentationPageSheet];
[self presentViewController:self.checkIn animated:YES completion:nil];
CGRect bounds = self.checkIn.view.superview.bounds;
bounds.size.height *= 0.8;
bounds.size.width *= 0.6;
self.checkIn.view.superview.bounds = bounds;
0

There are 0 answers