4

UIAlertViewログイン/パスワード付きのテキストフィールドを表示して、キーボードのタイプがタイプになるようにする方法はありUIKeyboardTypeEmailAddressますか?

私は次のように使用UIAlertViewします:

var alertView = new UIAlertView("Login".Translate(), "", null, "Cancel".Translate(), "Login".Translate());
alertView.AlertViewStyle = UIAlertViewStyle.LoginAndPasswordInput;

または、Objective-Cの場合:

UIAlertView *alertView = [[UIAlertView alloc]
                          initWithTitle:@"Title"
                          message:@"Message"
                          delegate:self
                          cancelButtonTitle:@"Cancel"
                          otherButtonTitles:@"Login", nil];
[alertView setAlertViewStyle:UIAlertViewStyleLoginAndPasswordInput];

ただし、私のアプリのユーザー名はすべて電子メールアドレスであるため、ログインテキストフィールドのキーボードを電子メールアドレスキーボードとして使用したいと思いますUIKeyboardTypeEmailAddress

何か案は?

4

1 に答える 1

8

とった。のテキストフィールドを取得し、UIAlertViewそこにスタイルを設定できます。

alertView.GetTextField(0).KeyboardType = UIKeyboardType.EmailAddress;

Obj-C:

[[alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeEmailAddress];
于 2012-06-20T16:14:38.117 に答える