Tôi tăng lượt xem này và thêm nó vào ListView làm tiêu đề. Tôi cố gắng để làm cho nó 500dp cao (cứng mã hóa, vì lợi ích của ví dụ này)Tiêu đề ListView bỏ qua layout_height
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical"
android:layout_width="match_parent" android:background="@drawable/repeat_background"
android:layout_height="500dp">
<ImageView android:id="@+id/filter_menu" android:src="@drawable/ic_sort"
android:layout_gravity="center_vertical" android:padding="8dp"
android:layout_weight="0"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:onClick="showPopup"/>
</LinearLayout>
Các ListView không tôn trọng authoritah header của nó và kết thúc tốt đẹp nó trên nội dung của nó. Bất cứ ai có thể vui lòng giải thích những gì sẽ xảy ra?
+1 để có câu trả lời phức tạp. Tôi không biết phải nghĩ gì về điều này; lỗi - hoặc tính năng? Sự trừu tượng, hoặc mô hình tâm thần bị phá vỡ khi mọi thứ không hoạt động như mong đợi. –
tuyệt vời, cảm ơn! – kiruwka