当我在iPad上使用带有addTextField的UIAlertController时,键盘无法从iOS10正常旋转。
iOS9工作正常,有人知道解决方法吗?
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];