草庐IT

UITextInputMode

全部标签

iphone - 如何使用 UITextInputMode

我需要创建一个检测键盘输入语言的方法。例如,当键盘语言是法语时会做某事,而当英语是英语时会做其他事情我在网上搜索找到了UITextInputMode但是我不知道怎么用,如果你能帮助我,我将不胜感激。谢谢 最佳答案 很简单,你可以这样做:UITextInputMode*textInput=[UITextInputModecurrentInputMode];NSString*primaryLanguage=textInput.primaryLanguage;NSLog(@"Currenttextinputis:%@",primaryLa

ios - UITextInputMode currentInputMode 已弃用。建议更换?

在我们的应用中,我们想要检测当前的键盘语言。例如,如果用户在Settings->General->Keyboard->Keyboards下设置了多语言键盘,我们想知道他们输入的是什么语言,并在更改时从NSNotificationCenter收到通知。-(void)viewDidLoad{[superviewDidLoad];NSNotificationCenter*nCenter=[NSNotificationCenterdefaultCenter];[nCenteraddObserver:selfselector:@selector(languageChanged:)name:UIT

ios - UITextInputMode.activeInputModes() 在 Swift 2 中崩溃

我想在Swift2中获取UITextInputMode,但UITextInputMode.activeInputModes()崩溃了。letx=UITextInputMode.activeInputModes()//crashherefortinx{print(t)} 最佳答案 我能够通过使用Objective-C桥解决这个错误。桥.h#ifndefBridge_h#defineBridge_h#import"Kludge.h"#endifKludge.h#ifndefKludge_h#defineKludge_h#import@i