Get writing language of “uitextview” iphone?

前端 未结 3 1656
时光说笑
时光说笑 2021-01-22 00:38

How can i get writing language of uitextview? or how can i know uitextview is right to left or left to right in current state?

相关标签:
3条回答
  • 2021-01-22 01:16

    In answer to your other question, you can get the keyboard language used from UITextInputMode docs: http://developer.apple.com/library/ios/#documentation/uikit/reference/UITextInputMode_Class/Reference/Reference.html

    0 讨论(0)
  • 2021-01-22 01:16

    This solution worked better for me

    [NSLocale characterDirectionForLanguage:self.textView.textInputMode.primaryLanguage] == NSLocaleLanguageDirectionRightToLeft
    
    0 讨论(0)
  • 2021-01-22 01:28
    [textView baseWritingDirectionForPosition:[textView beginningOfDocument] inDirection:UITextStorageDirectionForward] == UITextWritingDirectionRightToLeft
    

    Should return true if the UITextView is right-to-left, and false otherwise.

    Further documentation can be found here, if you need it!

    0 讨论(0)
提交回复
热议问题