我希望根据屏幕尺寸使网格视图中的图像具有更大的尺寸,即使我使用包装内容到图像视图&使列数固定它也留空间,我下载Picasso的图像 我的代码:
gridview的
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:verticalSpacing="0dp"
android:horizontalSpacing="0dp"
android:numColumns="2">
</GridView>
</FrameLayout>
图片视图
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/posterImage"
android:layout_height="wrap_content"
android:layout_width="wrap_content">
</ImageView>
答案 0 :(得分:0)
尝试手动添加layout_height
和layout_width
参数,而不是
wrap_content
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/posterImage"
android:layout_height="370dp"
android:layout_width="370dp">
</ImageView>
最佳做法是将dp边距放入dimen.xml文件中。
同样在gridView中,您应该更改match_parent
而不是fill_parent
;