Get writing language of “uitextview” iphone?

前端 未结 3 1660
时光说笑
时光说笑 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: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!

提交回复
热议问题