目标C - Iphone。如何默认显示数字键盘? [英] Objective C - Iphone. How can I show the numeric keyboard by default?

查看:85
本文介绍了目标C - Iphone。如何默认显示数字键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以下但没有运气。当用户点击UiTextfield我需要自动将键盘视图更改为数字视图时,这可能吗?
提前致谢。

I'm trying the following with no luck. When the user click on a UiTextfield i need to change the keyboard view to the numeric view automatically, is this possible? Thanks in advance.

推荐答案

UITextInputTraits 协议( UITextField 符合)具有类型为 UIKeyboardType的 keyboardType 属性

The UITextInputTraits protocol (which UITextField conforms to) has a keyboardType property of type UIKeyboardType.

myTextField.keyboardType = UIKeyboardTypeNumberPad;

这篇关于目标C - Iphone。如何默认显示数字键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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