我有一个ListView,项目是RelativeLayout,左边是文本,右边是LinearLayout中的ImageView。
我希望 LinearLayout**(white background)** 的高度是 fillParent 但它没有。
效果是:
有人可以帮忙吗?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_list_item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical" >
<TextView
android:id="@+id/main_list_item_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/main_list_item_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/main_list_item_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
android:id="@+id/main_list_item_delete_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="#ffffff"
android:gravity="center"
android:orientation="horizontal" >
<ImageView
android:id="@+id/main_list_item_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/main_list_item_check_margin_lr"
android:layout_marginRight="@dimen/main_list_item_check_margin_lr"
android:contentDescription="@string/none"
android:gravity="center"
android:src="@drawable/ic_ctx_del1" />
</LinearLayout>
</RelativeLayout>
main.xml 如下,其中包含 ListView:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="fill"
android:orientation="vertical" >
<!-- content -->
<LinearLayout
android:id="@+id/center"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginLeft="@dimen/main_margin"
android:layout_marginRight="@dimen/main_margin"
android:orientation="vertical"
android:layout_above="@id/adview_ayout">
<ListView
android:id="@+id/main_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>
</LinearLayout>
<!-- content end -->
<LinearLayout
android:id="@+id/main_layout_pb"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@android:color/transparent"
android:gravity="center"
android:orientation="vertical"
android:clickable="true"
android:visibility="gone">
<ProgressBar
android:id="@+id/main_pb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal" >
</ProgressBar>
</LinearLayout>
enter code here