我有一個線性佈局,其中包含一個textView和EditText水平排列。我有一個選擇語言在先前的活動(英語和阿拉伯語)。當我選擇英語當前對齊是好的,但是當我選擇阿拉伯語時,它應該顯示從右到左,這意味着在editText之後textView位置應該向右(在佈局中它將從左開始)。根據語言選擇對齊textview(LEFT-RIGHT)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/darkblue_bg"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<EditText
android:id="@+id/editusername"
android:layout_width="196dp"
android:layout_height="wrap_content"
android:background="@drawable/textfield_default"
android:ems="10" >
</EditText>
<TextView
android:id="@+id/username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
</LinearLayout>
有人請給我的解決方案...
嘗試安卓textDirection = 「區域設置」 –