我希望我的应用程序支持RTL .我已将 android:supportsRtl="true" 添加到清单中的 Application 元素,它看起来很棒 .但是,对于LTR / RTL,有一些布局应该保持不变 . 我知道我可以将布局文件复制到 layout-ldrtl 目录,但如果可能的话,我更喜欢只有1个资源副本 .
android:supportsRtl="true"
Application
layout-ldrtl
要强制LTR进行布局,可以将 android:layoutDirection="ltr" 添加到布局XML标记中,如下所示:
android:layoutDirection="ltr"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layoutDirection="ltr" ...>
1 回答
要强制LTR进行布局,可以将
android:layoutDirection="ltr"
添加到布局XML标记中,如下所示: