UIAlertView:UIAlertViewStyleSecureTextInput:数字键盘 [英] UIAlertView: UIAlertViewStyleSecureTextInput: Numeric keyboard

查看:266
本文介绍了UIAlertView:UIAlertViewStyleSecureTextInput:数字键盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用此UIAlertView进行登录弹出,

I'm currently using this UIAlertView to do a login popup,

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];

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

However I would like the text input to be a numeric keyboard instead of the regular keyboard

是否有一种简单的方法可以做到这一点,或者我是否需要研究创建自定义UIAleartView

Is there a easy way to do this, or do I have to look into creating a custom UIAleartView

推荐答案

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

You can try this to change the keyboard type of the UIAlertView's field:

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

这篇关于UIAlertView:UIAlertViewStyleSecureTextInput:数字键盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆