一直以为AlertView只有一种样式。嘎嘎。原来还有。
此方法iOS5.0以后。 iOS7以后自定义样式方法取消。所以不能再用。
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"" message:@"请输入密码"delegate:self cancelButtonTitle:nil otherButtonTitles:NSLocalizedStringFromTable(@"确认", nil, nil), nil];
alertView.alertViewStyle = UIAlertViewStyleSecureTextInput;//看这里。。可以这样用
[alertView textFieldAtIndex:0].keyboardType = UIKeyboardTypeNumberPad;
[alertView textFieldAtIndex:0].delegate = self;
[alertView show];
typedef NS_ENUM(NSInteger, UIAlertViewStyle) {
UIAlertViewStyleDefault = 0,
UIAlertViewStyleSecureTextInput,
UIAlertViewStylePlainTextInput,
UIAlertViewStyleLoginAndPasswordInput
};