0

我有一个模态视图(表单样式),我不希望它在键盘出现时向上移动,因为我里面有一个不遵循模态视图的弹出框,看起来非常糟糕。

基本上我想防止在键盘出现时向上移动模态视图

谢谢!!

这里的图像显示了它的外观

在此处输入图像描述

在此处输入图像描述

编辑 - 解决方案

谢谢你帮助我!!

我最后所做的是将样式更改为 UIModalPresentationPageSheet 并将超级视图边界更改为看起来像表单。

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;
4

0 回答 0