gpt4 book ai didi

ios - UIAlertView: UIAlertViewStyleSecureTextInput: 数字键盘

转载 作者:IT王子 更新时间:2023-10-29 08:16:50 25 4
gpt4 key购买 nike

我目前正在使用这个 UIAlertView 来做一个登录弹出窗口,

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Restricted"
message:@"Please Enter Code to Enable Fields"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"Login"
, nil];
alert.alertViewStyle = UIAlertViewStyleSecureTextInput;

[alert show];

但是我希望文本输入是数字键盘而不是常规键盘

有没有简单的方法可以做到这一点,还是我必须考虑创建自定义 UIAleartView

最佳答案

你可以尝试改变 UIAlertView 字段的键盘类型:

[[alert textFieldAtIndex:0] setDelegate:self];
[[alert textFieldAtIndex:0] setKeyboardType:UIKeyboardTypeNumberPad];
[[alert textFieldAtIndex:0] becomeFirstResponder];

关于ios - UIAlertView: UIAlertViewStyleSecureTextInput: 数字键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10579658/

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