如何在iPhone中转换键盘类型 [英] how convert keyboard type in iphone
问题描述
我正在尝试当用户单击UiTextfield时,我需要将键盘视图自动更改为Alpha视图,这可能吗?当用户在文本字段中输入内容时,他或她不应该在iphone的文本字段中输入数字值
I'm trying When the user click on a UiTextfield i need to change the keyboard view to the alpha view automatically, is this possible? when user enter in the textfield then he or she should not be alb to enter numeric value in text field in iphone
我该怎么做,请帮助我的朋友
how can i do this please help me friend
推荐答案
UITextField 的协议 UITextInputTraits
具有更改键盘类型的属性.
UITextField 's protocol UITextInputTraits
has the property to change the keyboard type.
@property(nonatomic) UIKeyboardType keyboardType
myTextField.keyboardType = UIKeyboardTypeASCIICapable;
尝试使用我不确定您是否可以在现有的键盘视图上使用Alpha效果但是 UITextField
提供了属性 inputView
来添加自己的输入视图(自定义键盘).
I'm not sure about whether you could bring the alpha effect on the existing keyboard view or not
But UITextField
provide a property inputView
to add own input view (custom keyboard).
@property (readwrite, retain) UIView *inputView;
这篇关于如何在iPhone中转换键盘类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!