所以我有一个UIAlertController与UITextField添加的输入,但由于某些原因,文本框似乎远远小于它应该是.知道为什么吗?
这是截图
这是守则
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)
谢谢!