2017-07-28 87 views
0

我在華爲設備文字對齊問題。 我的文本窗口有正確的文本對齊(with 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> 

當我設置重力完 - 文字出現在TextView的左側。

1 - textview with android:layout_width="match_parent" and android:gravity="end", 2 - textview with wrap_content

也許你知道如何解決它?

我想有非標準啓動 - 左/末端 - 右引力

Thx!

Screenshot

+0

嘗試使用'重力= 「left」或「right」' –

+0

當我設置重力左/右 - 它的工作原理,但我使用默認警報對話框和警報對話框中的標題也出現在右側 –

+0

對不起,你的問題還不清楚。你需要解決什麼問題? –

回答

0

解決方案成立! 華爲有奇怪的行爲,當我設置默認語言環境(它啓用強制RTL) 當我設置語言區域設置(美國,RU,ZH等),而不是「默認」 - 禁用RTL