Tôi có chế độ xem danh sách và muốn đặt nội dung cả ở trên (trên trục y) và bên dưới (trục y) bao gồm hình ảnh, chế độ xem văn bản và một hàng nút. Dưới đây là một phiên bản đơn giản của những gì tôi đang tạo ra. Thật không may là danh sách bìa (tức là trên trên trục z) các tiêu đề để văn bản tiêu đề không hiển thị thay vì bên dưới (trên trục y)Làm cách nào để đặt tiện ích con ở trên và dưới chế độ xem danh sách?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:id="@+id/footer"
android:text="footer"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentBottom="true"
/>
<ListView android:id="@+id/list_view"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_above="@id/footer"
android:background="#ff9999ff"/>
<TextView android:id="@+id/header"
android:text="header"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_alignParentTop="true"
android:layout_above="@id/list_view"
android:baselineAlignBottom="false"
/>
</RelativeLayout>
Đây là lớp Hoạt động tương ứng:
public class SampleListActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_activity);
}
}
android: định hướng sai ở đây tôi nghĩ – letroll