2016-05-17 27 views
1

是否可以将UIAlertView这两种输入类型作为密码类型?
我正在实施更改密码功能,并想知道这是否可能。UIAlertView - 使两个输入字段都安全

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Change password" message:nil delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Change password", nil]; 
alert.alertViewStyle = UIAlertViewStyleLoginAndPasswordInput; 
[alert textFieldAtIndex:0].placeholder = @"New password"; 
[alert textFieldAtIndex:1].placeholder = @"Confirm password"; 
[alert show]; 

回答

2

你去那里:

[alert textFieldAtIndex:0].secureTextEntry = YES; 
[alert textFieldAtIndex:1].secureTextEntry = YES; 
+0

Correcto :)会接受你的答案仅需9分钟按StackOverflow上。 – Nitish

+0

在另一个主题上,是否可以更改这些输入字段的框架? – Nitish