开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜