Sportica   Sportica

iOS 判断当前输入法。UITextInputMode

//判断当前输入法
-(void)textViewDidChangeSelection:(UITextView *)textView
{
    NSLog(@"wewe:%@",[[UITextInputMode currentInputMode] primaryLanguage]);
//do something   en-US为英文。。zh-hans为中文
    /*
    if ([[[UITextInputMode currentInputMode] primaryLanguage] isEqualToString: @"en-US"]) { 
        NSLog(@"en-US"); 
    } 
    else 
    { 
        NSLog(@"zh-hans"); 
    } 
     */
     
}
posted @ 2012-09-12 13:46  qingjoin  阅读(2754)  评论(0编辑  收藏  举报
  Sportica