Tôi đang sử dụng RelativeLayout để đặt Chế độ xem. Bây giờ tôi muốn thêm một Chế độ xem khác bên dưới Chế độ xem đầu tiên và sẽ được căn giữa được gọi là Chế độ xem đầu tiên. Nhưng có vẻ như không có tùy chọn thats được gọi là một cái gì đó như android: layout_alignCenter .. Làm thế nào tôi có thể đạt được nhiệm vụ này?Chế độ xem trung tâm bên dưới một Chế độ xem khác
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent" android:gravity="top">
<TextView
android:text="Blaa"
android:id="@+id/TextView1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="100dp"
android:gravity="center"
/>
<TextView
android:text="Foo"
android:id="@+id/TextView2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@+id/TextView1"
--- NEED STH THAT ALIGNS THIS SECOND VIEW CENTRAL UNDER THE FIRST VIEW --
/>
</RelativeLayout>
alignParentCenter ... – Warpzit
Điều đó sẽ sắp xếp Xem tôi trung tâm trong các phụ huynh, nhưng tôi muốn sắp xếp nó-xăng tập trung sang Xem thứ hai - Xin lỗi câu hỏi là một chút mơ hồ – Salo
Với 'android: gravity =" center "' bạn có cả hai trung tâm, do đó TextView2 được đặt ở giữa TextView1. – iCantSeeSharp