【问题标题】:ios9 UIAlertController uitextfield too smallios9 UIAlertController uitextfield 太小
【发布时间】:2016-06-12 02:29:03
【问题描述】:

我正在使用此代码显示 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];

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

【问题讨论】:

    标签: ios ios9 uialertview uialertcontroller


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      我遇到了与上述问题中的 OP 相同的问题,在我的情况下,它原来是我正在从事的项目中使用的 PixateFreestyle 框架。

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多