我有UIAlertView和文本字段。
UIAlertView *corrmsg=[[UIAlertView alloc] initWithTitle:@"" message:@"Enter Password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK",@"Forgot Password", nil];
corrmsg.alertViewStyle = UIAlertViewStylePlainTextInput;
[corrmsg show];
[corrmsg release];
在iPad上iOS 10.1.1文本字段变得不可见,没有光标,没有框,虽然键盘出现并且工作正常,如果你只是盲目输入。
任何人都知道如何解决这个问题?
切换到UIAlertController,但没有帮助:(
UIAlertController *alertController=[UIAlertController alertControllerWithTitle:@"" message:@"Enter Password" preferredStyle:UIAlertControllerStyleAlert];
[alertController addTextFieldWithConfigurationHandler:^(UITextField *textField){
textField.placeholder = NSLocalizedString(@"Enter Password", @"Password");
}];
[alertController addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[self okBttn:alertController.textFields.firstObject.text];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"Forgot Password" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[self forgotPasswordBttn];
}]];
[alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
[self cancelBttn];
}]];
[self presentViewController:alertController animated:YES completion:nil];
[alertController release];
更新:提升部署目标> 9.0修复了UIAlertController!
答案 0 :(得分:0)
你在哪里配置UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:(@"")
message:@"Enter Password" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)];
[myTextField setBackgroundColor:[UIColor whiteColor]];
[myAlertView addSubview:myTextField];
[myAlertView show];
[myAlertView release];
}
?
试试这样的smthn:
$onChanges