Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios objective C中的键盘语言_Ios_Objective C_Uikeyboard - Fatal编程技术网

Ios objective C中的键盘语言

Ios objective C中的键盘语言,ios,objective-c,uikeyboard,Ios,Objective C,Uikeyboard,是否存在检测键盘语言切换的通知或委托函数 当我按键盘上的语言键时。。我需要一个在代码中处理此问题的委托函数来更改UITextfield的方向。根据: 答案是,当您切换语言时,UIKeyboardDidShowNotification会为每次更改触发 因此,您只需注册该通知,然后运行代码: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeybo

是否存在检测键盘语言切换的通知或委托函数

当我按键盘上的语言键时。。我需要一个在代码中处理此问题的委托函数来更改UITextfield的方向。

根据:


答案是,当您切换语言时,UIKeyboardDidShowNotification会为每次更改触发

因此,您只需注册该通知,然后运行代码:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];

- (void)keyboardWasShown:(NSNotification *)notification
{
   NSString * currentLanguage = [UITextInputMode currentInputMode].primaryLanguage;
}
更新

上述方法不起作用,但是,如果我们注册到
UITEmputeCurrentInputModeddChangeNotification
我们会收到一个回调。

根据:


答案是,当您切换语言时,UIKeyboardDidShowNotification会为每次更改触发

因此,您只需注册该通知,然后运行代码:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];

- (void)keyboardWasShown:(NSNotification *)notification
{
   NSString * currentLanguage = [UITextInputMode currentInputMode].primaryLanguage;
}
更新

上述方法不起作用,但是,如果我们注册到
UITEmputeCurrentInputModeddChangeNotification
我们会收到一个回调。

根据:


答案是,当您切换语言时,UIKeyboardDidShowNotification会为每次更改触发

因此,您只需注册该通知,然后运行代码:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];

- (void)keyboardWasShown:(NSNotification *)notification
{
   NSString * currentLanguage = [UITextInputMode currentInputMode].primaryLanguage;
}
更新

上述方法不起作用,但是,如果我们注册到
UITEmputeCurrentInputModeddChangeNotification
我们会收到一个回调。

根据:


答案是,当您切换语言时,UIKeyboardDidShowNotification会为每次更改触发

因此,您只需注册该通知,然后运行代码:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWasShown:) name:UIKeyboardDidShowNotification object:nil];

- (void)keyboardWasShown:(NSNotification *)notification
{
   NSString * currentLanguage = [UITextInputMode currentInputMode].primaryLanguage;
}
更新


上述方法不起作用,但是,如果我们注册到
uitePutCurrentInputModedChangeNotification
我们会收到一个回调。

检查下面的链接:检查下面的链接:检查下面的链接:检查下面的链接:UIKeyboardDidShowNotification仅在uikeyboard显示时触发,但如果我按languages键更改语言在键盘上,它没有发射任何东西:(@ZiadBouIsmail你是对的。我想它以前工作过,现在不再工作了。请查看我的更新。谢谢@GadMarkovits它工作了:)UIKeyboardDidShowNotification仅在uikeyboard显示时触发,但如果我按languages键更改键盘语言,则不会触发任何内容:(@ZiadBouIsmail你是对的。我猜它以前工作过,现在不再工作。请查看我的更新。谢谢@GadMarkovits它工作了:)UIKeyboardDidShowNotification仅在uikeyboard显示时触发,但如果我按languages键更改键盘语言,则不会触发任何内容:(@ZiadBouIsmail你是对的。我猜它以前工作过,现在不再工作。请查看我的更新。谢谢@GadMarkovits它工作了:)UIKeyboardDidShowNotification仅在uikeyboard显示时触发,但如果我按languages键更改键盘语言,则不会触发任何内容:(@ZiadBouIsmail你是对的。我猜它以前工作过,现在不再工作。请查看我的更新。谢谢@GadMarkovits它工作了:)