IO7:如果在UIAlertview中使用,键盘将变为透明

时间:2014-04-18 09:22:33

标签: iphone objective-c cordova ios7 uialertview

如何在IOS7中禁用键盘的透明度?

我正在使用phonegap应用程序并使用下面的代码来显示提示符:

UIAlertView* dialog = [[UIAlertView alloc] init];
[dialog setDelegate:self];
[dialog setTitle:@"Location"];
[dialog setMessage:[NSString stringWithFormat:@"Enter Location"]];
[dialog addButtonWithTitle:@"Cancel"];
[dialog addButtonWithTitle:@"Enter"];
dialog.alertViewStyle = UIAlertViewStylePlainTextInput;

dialog.tag = 7;

UITextField *textField = [dialog textFieldAtIndex:0];

[textField setText:[NSString stringWithFormat:@"%@",marker.snippet]];


[dialog show];
[dialog release];

请帮帮我 谢谢:))

1 个答案:

答案 0 :(得分:0)

您可以在ViewWillAppear中尝试此方法

[[UITextField appearance] setKeyboardAppearance:UIKeyboardAppearanceDefault];

在UIAlertView中设置:

 UITextField *textField = [alert textFieldAtIndex:0];
 textField.keyboardAppearance=UIKeyboardAppearanceDefault;