Which UIKeyboardType can I use on the iPad

后端 未结 2 1330
萌比男神i
萌比男神i 2020-12-19 07:10

I have a a textField object in my iPad app. I would like to give the user a convenient keyboard for entering numbers. In my code I added:

UITextField *textFi         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-19 08:04

    I tested which keyboard types are available for iPad/iPhone using the Simulator after receiving the warning

    "Can't find keyplane that supports type 8 for keyboard Wildcat-Landscape-QWERTY-Pad; using 2592645918_Wildcat-Alphabetic-Keyboard_Capital-Letters"

    on the iPad for the UIKeyboardTypeDecimalPad. Hopefully this is useful for the next person that stumbles here.

    iPad:

    • UIKeyboardTypeASCIICapable
    • UIKeyboardTypeNumbersAndPunctuation
    • UIKeyboardTypeURL
    • UIKeyboardTypeNumberPad
    • UIKeyboardTypeNamePhonePad
    • UIKeyboardTypeEmailAddress
    • UIKeyboardTypeTwitter

    So, all of them except UIKeyboardTypeDecimalPad. using UIKeyboardTypeDecimalPad gets you nothing but a slap on the wrist in either iOS 5.1 or 6.1.

    iPhone:

    • UIKeyboardTypeASCIICapable
    • UIKeyboardTypeNumbersAndPunctuation
    • UIKeyboardTypeURL
    • UIKeyboardTypeNumberPad
    • UIKeyboardTypeNamePhonePad
    • UIKeyboardTypeEmailAddress
    • UIKeyboardTypeDecimalPad
    • UIKeyboardTypeTwitter

    i.e. all of them

提交回复
热议问题