标签: iphone cocoa-touch
如何确定可见键盘是数字键盘还是默认键盘?
答案 0 :(得分:1)
您应该向UITextInputTraits询问其keyboardType-propery。 UITextField和UITextView都实现了这个协议。
一个例子是:
if(myTextField.keyboardType == UIKeyboardTypeURL) { // do something if it wants URLs }
查看the documentations了解更多信息。