how to identify the visible keyboard is whether numberpad or default keyboard?
How can one identify if the visible keyboard is a nu开发者_运维问答mberpad or the default keyboard?
You should ask the UITextInputTraits for its keyboardType-propery. Both UITextField and UITextView implements this protocol.
An example would be:
if(myTextField.keyboardType == UIKeyboardTypeURL) {
// do something if it wants URLs
}
Check the documentations for more.
精彩评论