Language Specific layout for android

后端 未结 3 1127
独厮守ぢ
独厮守ぢ 2020-12-31 12:15

I know that we can display multiple languages support for our android application with different values folder example values-en , values-ar.

My question is can we

3条回答
  •  余生分开走
    2020-12-31 12:21

    The layout direction of your application. ldrtl means "layout-direction-right-to-left". ldltr means "layout-direction-left-to-right" and is the default implicit value.

    This can apply to any resource such as layouts, drawables, or values.

    For example, if you want to provide some specific layout for the Arabic language and some generic layout for any other "right-to-left" language (like Persian or Hebrew) then you would have:

    res/
    layout/   
        main.xml  (Default layout)
    layout-ar/  
        main.xml  (Specific layout for Arabic)
    layout-ldrtl/  
        main.xml  (Any "right-to-left" language, except
                  for Arabic, because the "ar" language qualifier
                  has a higher precedence.)
    

    Note: To enable right-to-left layout features for your app, you must set supportsRtl to "true" and set targetSdkVersion to 17 or higher.

提交回复
热议问题