我在华为设备上遇到文本对齐问题。
我的文本小部件具有正确的文本对齐方式(带有 android:gravity="start")
应用标签:
<application
android:supportsRtl="true"
android:theme="@style/AppTheme"
android:allowBackup="true"
android:name=".ShopApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
/>
和 TextView XML(例如)
<TextView
android:id="@+id/tv_value"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
android:text="23.000.000.097"
android:textColor="@color/background"
android:textSize="30sp"/>
应用主题:
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/primary_text_color</item>
<item name="colorPrimaryDark">@color/background</item>
<item name="colorAccent">@color/accent_red_color</item>
<item name="colorControlNormal">@android:color/white</item>
</style>
当我设置重力END时 - 文本出现在TextView
的左侧。
也许你知道如何解决它?
我想要标准的开始 - 左/结束 - 右重力
谢谢!
最佳答案
解决方案成立! 当我设置默认区域设置时,华为有奇怪的行为(它启用了强制 RTL) 当我设置语言区域设置(US、RU、ZH 等)而不是“默认”时 - RTL 已禁用
关于java - 华为设备上的文本对齐问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45371538/