我想要一個TextView來填充左邊的按鈕和右邊佈局的邊緣之間的空間。相對佈局的怪異邊距問題
<TextView
android:id="@+id/welcomeHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/setInfusionReminder"
android:layout_marginRight="20dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:gravity="center"
android:text="Welcome!" />
我在編輯器中看到的是android:layout_marginRight
應用在左邊。最終結果是左側40dp餘量和右側0餘量。
您是否嘗試過使用'android:layout_gravity =「center」'? – b3by 2012-07-10 14:35:36