我刚刚接触安卓开发,正在开发一个应用程序,该应用程序从服务器下载图片并在网格视图中显示这些图片。但是,当在更大的屏幕手机上运行应用时,会出现一些额外的空白。以下是一些屏幕截图。我该如何解决?每个项目的模型都具有固定的高度和宽度,为110dp。
我的图片模型:
<?xml version="1.0" encoding="utf-8"?>
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="110dp"
android:layout_height="110dp"
app:srcCompat="@drawable/post2"
android:id="@+id/imageView2"
android:adjustViewBounds="true"
android:scaleType="centerCrop"
android:layout_margin="1.5dp" />
我的 RecyclerView:
<android.support.v7.widget.RecyclerView
android:id="@+id/gallerygrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:numColumns="auto_fit"
android:stretchMode="columnWidth"
android:visibility="visible"
android:layout_gravity="center">
</android.support.v7.widget.RecyclerView>