Is there any way of displaying a UIAlertView
with Login/Password text fields, so that the keyboard type is of type UIKeyboardTypeEmailAddress
?
I use a UIAlertView
as follows:
var alertView = new UIAlertView("Login".Translate(), "", null, "Cancel".Translate(), "Login".Translate());
alertView.AlertViewStyle = UIAlertViewStyle.LoginAndPasswordInput;
or, in Objective-C:
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Title"
message:@"Message"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Login", nil];
[alertView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];
but all user names of my app are e-mail addresses, so I'd like to have the keyboard of the login textfield as an e-mail address keyboard, i.e. a UIKeyboardTypeEmailAddress
.
Any ideas?
Got it. You can get the textfield of the UIAlertView
and set the style there:
alertView.GetTextField(0).KeyboardType = UIKeyboardType.EmailAddress;
Obj-C:
[[alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeEmailAddress];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With