Vì vậy, tôi có bố trí này:android "layout_alignParentBottom" trong cách bố trí tương đối
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFF00"
android:minHeight="100dp"
android:layout_gravity="bottom"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:textColor="#000000"
android:background="#FF0000"
android:text="Hello World"
/>
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_alignParentRight="true"
android:text="button"/>
</RelativeLayout>
và đây là cách có vẻ:
nhưng nếu tôi thêm android:layout_alignParentBottom="true"
vào nút ở đây là trông như thế nào:
- Ai đó có thể giải thích cho tôi hành vi này không?
- Làm thế nào để đặt nút của tôi ở dưới cùng mà không thay đổi kích thước bố cục màu vàng và không thêm hàng nghìn bố cục cho giải pháp?
Lỗi này vẫn tồn tại? –
Tôi đã gặp sự cố này trên Android 2.2 và 4.0.0 nhưng tôi nghĩ điều này cũng xảy ra trên các nền tảng khác quá –