相关疑难解决方法(0)

UIAlertController的文本字段宽度比平常小

所以我有一个UIAlertControllerUITextField添加的输入,但由于某些原因,文本框似乎远远小于它应该是.知道为什么吗?

这是截图

警报视图文本域图像

这是守则

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

[alert addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) {

    textField.keyboardType = UIKeyboardTypeNumberPad;
    textField.placeholder = @"I am a placeholder";

}];


UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"Submit"
                                              style:UIAlertActionStyleDefault
                                            handler:nil];

[alert addAction:okAction];


[self presentViewController:alert animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

谢谢!

objective-c ios uialertcontroller xcode7

6
推荐指数
1
解决办法
855
查看次数

标签 统计

ios ×1

objective-c ×1

uialertcontroller ×1

xcode7 ×1