参考文献:
首先修改AndroidManifest.xml->application节点,如存在修改不存在添加
android:supportsRtl="true"
使APP支持从右至右布局
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme"
android:supportsRtl="true">
在Activity onCreate方法中添加
//从右至左布局
getWindow().getDecorView().setLayoutDirection(View.LAYOUT_DIRECTION_RTL);