0
我有一个网格视图,两行之间有空格。我试图删除空白区但没有成功。那么有谁能告诉我如何去除白色间距?GridView行间距填满屏幕
这里是我的xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical" >
<GridView
android:id="@+id/bg_chooser_grid"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:numColumns="auto_fit"/>
</LinearLayout>
这里的GridItem XML:
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/grid_item_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:scaleType="centerInside"
android:src="@drawable/ic_launcher" />
的 “适配器的重要组成部分”:
gridImg = (ImageView) vi.findViewById(R.id.grid_item_img);
gridImg.setImageResource(data.get(position));
这里是它的外观:
你有一个自定义的布局来显示图像?起初我错误地认为它是一个交错的griview。 – Raghunandan
@Raghunandan问题已更新 –