我有一個列表視圖,它的列表項是使用數組列表生成的,它創建佔用大量空間的不必要的空白空間。清單週圍的空白查看項目
如何將它從列表項中刪除?
這裏是我的列表視圖:
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="0dp" android:layout_weight="1"
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"/>
而我的列表項:
<?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">
<ImageView
android:id="@+id/photo"
android:layout_width="140dip"
android:layout_height="140dip"
android:paddingRight="15dp"
android:paddingLeft="15dp"/>
<TextView android:id="@+id/name"
android:textSize="14sp"
android:textStyle="bold"
android:textColor="#000000"
android:paddingTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/photo"/>
<TextView android:id="@+id/itemDescription"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/name"
android:layout_toRightOf="@id/photo"/>
<TextView android:id="@+id/price"
android:textSize="19sp"
android:textStyle="bold"
android:textColor="#32cd32"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/itemDescription"
android:layout_toRightOf="@id/photo"/>
</RelativeLayout>
截圖:
哪裏是白色空間?你有任何截圖嗎? –
用你正在談論的這些空白處顯示圖片。 –
@RenanBandeira和Piotr Chojnacki-對不起:)我以爲我已經加入了它..現在請添加它,請檢查 – coder