iOS 随着版本的越高,支持的版本也越来高,底本版反而不支持了,但是有些APP却要求支持低版本,UIAlertView就是其中之一,接下来便是它的常用属性,
UIAlertViewStyleDefault = ,//默认属性正常显示
UIAlertViewStyleSecureTextInput,//安全输入
UIAlertViewStylePlainTextInput,//一个输入框正常输入
UIAlertViewStyleLoginAndPasswordInput//两个输入框正常输入,第二个默认是保密输入,会以黑点形式如果想正常显示内容,[person_nameField setSecureTextEntry:NO];即可
UITextField * person_nameField;
UITextField * driver_cardsField;
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"msg info"
delegate:self
cancelButtonTitle:@"取消"
otherButtonTitles:@"确定", nil];
[alertView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
driver_cardsField = [alertView textFieldAtIndex:0];
person_nameField = [alertView textFieldAtIndex:1];
driver_cardsField.textColor = [UIColor colorWithHexString:@"#323232"];
person_nameField.textColor = [UIColor colorWithHexString:@"#323232"];
driver_cardsField.placeholder = @"请输入你的身份证号";
person_nameField.placeholder = @"请输入你的姓名";
[alertView show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{//点击弹窗按钮后协议的方法
if (buttonIndex == 0) {//取消点击执行
} else if (buttonIndex == 1){//确定点击执行
}
}