0
我在我的應用程序中有一個列表視圖,我想使其行全屏。如何使全屏列表視圖行
我將每件事情都設置爲match_parent,但它沒有奏效。
它只需要一半的屏幕。
我該如何做到這一點?
這是我的列表視圖代碼:
<ListView
android:id="@+id/listviewFactoriPortfolio"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</ListView>
,這是我對每行自定義佈局:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:background="#FFFFFF"
android:gravity="center"
android:orientation="vertical"
android:padding="5dp" >
<ImageView
android:id="@+id/imgImageItem"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
android:padding="5dp"
android:scaleType="fitXY"
android:src="@drawable/photo_2" />
<TextView
android:id="@+id/txtNameItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:gravity="center"
android:padding="5dp"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/txtExplainItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/txtNameItem"
android:layout_margin="5dp"
android:gravity="center"
android:padding="5dp"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/txtCostItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/imgImageItem"
android:layout_alignParentBottom="true"
android:layout_margin="5dp"
android:gravity="center"
android:padding="5dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/txtDestributeDateItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/txtCostItem"
android:layout_margin="5dp"
android:gravity="center"
android:padding="5dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/txtAddressItem"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/txtDestributeDateItem"
android:layout_margin="5dp"
android:gravity="center"
android:padding="5dp"
android:text="Small Text"
android:textAppearance="?android:attr/textAppearanceSmall" />
</RelativeLayout>