ios9 UIAlertController uitextfield 太小

ios9 UIAlertController uitextfield too small

我正在使用此代码显示 UIAlert,它会询问简单的输入

UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Alert" message:@"Message" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"Click" style:UIAlertActionStyleDefault handler:nil]];
[alert addTextFieldWithConfigurationHandler:^(UITextField *textField) {
    textField.placeholder = @"Enter text:";
}];
[self presentViewController:alert animated:YES completion:nil];

也尝试了 iOS 7

的代码
UIAlertView *alertViewCustomQuestion=[[UIAlertView alloc]initWithTitle:@"Custom Question" message:@"Please enter your custom question!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok",nil];
alertViewCustomQuestion.alertViewStyle=UIAlertViewStylePlainTextInput;
[alertViewCustomQuestion show];

两者显示相同的结果。虽然我看到的任何例子都有很好的宽度。

我正在修复别人代码的错误,最后发现有一些类别正在改变它的行为。

只是将此添加为其他人的参考,他们可能会遇到类似的问题。

我遇到了与上述问题中的 OP 相同的问题,在我的情况下,结果证明是我正在处理的项目中使用的 PixateFreestyle 框架。

显然该框架不再积极开发,但幸运的是有一种 FIX for the issue.