来自iPad上的iOS10的UIAlertController + addTextField方向问题

时间:2016-10-29 11:11:08

标签: ios ios10 uialertcontroller

当我在iPad上使用带有addTextField的UIAlertController时,键盘无法从iOS10正常旋转。

iOS9工作正常,有人知道解决方法吗?

enter image description here

UIAlertController *alert =   [UIAlertController
                              alertControllerWithTitle:@"title"
                              message:nil
                              preferredStyle:UIAlertControllerStyleAlert];

UIAlertAction *done = [UIAlertAction actionWithTitle:NSLocalizedString(@"Done", nil)
                                               style:UIAlertActionStyleDefault
                                             handler:^(UIAlertAction * action) {

                                                 UITextField *textField = alert.textFields.firstObject;
                                             }];

UIAlertAction *cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", nil)
                                                 style:UIAlertActionStyleCancel
                                               handler:nil];

[alert addAction:cancel];
[alert addAction:done];

[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
}];

[self presentViewController:alert animated:YES completion:nil];

0 个答案:

没有答案