当该属性应在框架中可用时,我一直在获取未声明的属性。
UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"Email Alert" message:@"Enter your Email Address" delegate:self cancelButtonTitle:@"Hide" otherButtonTitles:nil];
[alert setAlertViewStyle:UIAlertViewStyleSecureTextInput];
[alert show];
[alert release];
最佳答案
我已经以这种方式使用UIAlertViewStylePlainTextInput。请根据需要修改代码。
alertType = @"phoneNumberAlert";
UIAlertView *phoneNumberAlert = [[UIAlertView
alloc]initWithTitle:@"Notice"
message:@"Please enter your Phone Number" delegate:self
cancelButtonTitle:nil otherButtonTitles:@"Ok", nil];
[phoneNumberAlert setAlertViewStyle:UIAlertViewStylePlainTextInput];
UITextField *alertTextField = [phoneNumberAlert textFieldAtIndex:0];
alertTextField.keyboardType = UIKeyboardTypeNumberPad;
[phoneNumberAlert show];
[phoneNumberAlert release];
关于iphone - UIAlertViewStylePlainTextInput未声明,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14160531/