我想刪除Gridview中的列或行的網格之間的任何空格。任何幫助將不勝感激。刪除gridview中的網格之間的空格
這裏是我的xml文件中的GridView
<GridView
android:id="@+id/grid"
android:layout_width="fill_parent"
android:layout_height="400dp"
android:layout_marginTop="50dp"
android:listSelector="@android:color/transparent"
android:fadingEdgeLength="0px"
android:alwaysDrawnWithCache="true"
android:clipChildren="true"
android:columnWidth="100dp"
android:gravity="center_horizontal"
android:numColumns="auto_fit"
android:scrollingCache="true"
android:smoothScrollbar="true"
android:stretchMode="columnWidth"
android:verticalSpacing="2dp"></GridView>
這裏是我的everycell.xml file.Hope這將有助於
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dp"
>
<ImageView
android:layout_height="120dp"
android:layout_width="120dp"
android:layout_weight="1"
android:id="@+id/imageView"
android:gravity="center"
android:adjustViewBounds="true"
android:orientation="vertical"/>
<TextView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/text"
android:textSize="18sp"
android:textStyle="bold"
android:singleLine="true"
android:textColor="@android:color/black"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
刪除垂直間距 – 2014-10-22 10:53:10
不行,不起作用。 – Soham 2014-10-22 10:55:28
試過columnWidth =「wrap_content」? – 2014-10-22 10:56:17