0

我正在尝试在 7 英寸三星平板电脑中实现 StaggeredGridView,但是当列数设置为 2 时,它只显示 9 个项目中的 3 个。当列数设置为 3 时,它显示 9 个项目中的 4 个。

同样的事情在手机中运行良好,但在 7 英寸平板电脑中它复制了上述行为。

你能帮我做同样的事情并告诉我解决方法吗?

下面是xml文件

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<ImageView
    android:id="@+id/imgDashboard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:adjustViewBounds="true"
    android:src="@drawable/dashboard_image" />

<com.etsy.android.grid.StaggeredGridView       xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/list_dashboard"
    android:layout_below="@+id/imgDashboard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:item_margin="0dp" />


</RelativeLayout>
4

0 回答 0