我正在使用此代码显示 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"lease enter your custom question!" delegate:self cancelButtonTitle"Cancel" otherButtonTitles"Ok",nil];
alertViewCustomQuestion.alertViewStyle=UIAlertViewStylePlainTextInput;
[alertViewCustomQuestion show];
我正在修复别人的代码的错误,最后发现有一些类别正在改变它的行为。
关于ios9 UIAlertController uitextfield 太小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37770180/
欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://jike.in/) | Powered by Discuz! X3.4 |