android determine if device is in right to left language/layout

后端 未结 8 1898
予麋鹿
予麋鹿 2020-12-09 07:49

Is there a way to determine if the device is in a right to left language (something like Arabic) as opposed to something that\'s left to right (English)?

Something c

8条回答
  •  伪装坚强ぢ
    2020-12-09 08:34

    Gr, a little bit longer googling and I would have found it before posting:

    if (ViewCompat.getLayoutDirection(getView()) == ViewCompat.LAYOUT_DIRECTION_LTR) {
        // ...
    }
    else {
        // ...
    }
    

    http://developer.android.com/reference/android/support/v4/view/ViewCompat.html#getLayoutDirection(android.view.View)

提交回复
热议问题