Is it possible to detect the current keyboard input method on the iPhone?

前端 未结 3 1911
一生所求
一生所求 2020-12-18 07:18

I want to know the current input method the user is typing in such as En (english), German, Chinese, etc... Maybe keyboard type is what I am after, but documentation seems

相关标签:
3条回答
  • 2020-12-18 07:49

    In iOS4.2 there is a new class UITextInputMode that is exactly what you want. (Oops, this is still under NDA. If you have no iOS dev center account please don't read this answer ;) )

    You can query current mode (English, French, Japanese, etc) or get notifications when it changes (the keyboard language changes)

    UITextInputMode documentation (requires log in)

    0 讨论(0)
  • 2020-12-18 08:09

    currentInputMode is deprecated since iOS7, be careful.

    currentInputMode

    Returns an instance representing the current text-input mode. (Deprecated in iOS 7.0.)

    0 讨论(0)
  • 2020-12-18 08:11

    here is a tutorial

    http://www.switchonthecode.com/tutorials/a-simple-localization-example-for-the-iphone

    NSLocale* curentLocale = [NSLocale currentLocale];
    
    0 讨论(0)
提交回复
热议问题