gpt4 book ai didi

ios9 UIAlertController uitextfield 太小

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:05:35 26 4
gpt4 key购买 nike

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

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

最佳答案

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

关于ios9 UIAlertController uitextfield 太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37770180/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com