gpt4 book ai didi

iphone - 结合 UIAlertViewStyleLoginAndPasswordInput 与 UIKeyboardTypeEmailAddress

转载 作者:可可西里 更新时间:2023-11-01 05:14:50 24 4
gpt4 key购买 nike

有没有办法显示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 .

有什么想法吗?

最佳答案

明白了。您可以获得 UIAlertView 的文本字段并在那里设置样式:

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

objective-C :

[[alertView textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeEmailAddress];

关于iphone - 结合 UIAlertViewStyleLoginAndPasswordInput 与 UIKeyboardTypeEmailAddress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11123656/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com