2016-05-17 29 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