开发者

how to identify the visible keyboard is whether numberpad or default keyboard?

开发者 https://www.devze.com 2023-02-15 23:14 出处:网络
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 im

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

精彩评论

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