Tôi muốn tạo hộp thoại để hiển thị tiêu đề và thẻ video. Văn bản bên dưới Tôi muốn thêm các nút Xem, Chỉnh sửa và Xóa và làm cho các thành phần này có cùng kích thước. Có ai biết làm thế nào để sửa đổi tập tin bố trí .xml để làm cho các yếu tố bên trong LinearView cùng kích thước?Android: Làm thế nào để làm cho tất cả các phần tử bên trong LinearLayout cùng kích thước?
File bố trí hiện tại trông như thế này:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txtTitle" android:text="[Title]" >
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/txtTags"
android:text="[Tags]" >
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnPlay"
android:text="View">
</Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnEdit"
android:text="Edit">
</Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnDelete"
android:text="Delete">
</Button>
</LinearLayout>
</LinearLayout>
tôi sẽ đánh giá cao nếu có ai có thể hiển thị các giải pháp bằng cách sửa đổi nội dung tập tin dán.
Cảm ơn!
Nếu bạn _REALLY_ muốn bạn, bạn có thể sử dụng TableLayout với android: stretchColumns = "0,1,2". –
Tuyệt vời ... vì vậy điều này có nghĩa, nếu chúng ta đặt chiều rộng là 0px, trọng lượng sẽ ghi đè cài đặt? Tại sao nó như vậy? – noob
Điều này làm việc hoàn hảo. – Proverbio