android gridview 充满屏幕,android – 如何强制GridView使用整个屏幕(无论显示大小)?...

我有以下布局文件,后面有一个GridView和一个

ImageView作为背景.

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="fill_parent"

android:layout_height="fill_parent"

android:background="#FFFFFF">

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:layout_gravity="bottom|right"

android:layout_marginRight="-70dp"

android:layout_marginBottom="-50dp"

android:src="@drawable/s_background"/>

android:layout_width="fill_parent"

android:layout_height="fill_parent">

android:id="@+id/gridview"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:columnWidth="90dp"

android:numColumns="auto_fit"

android:verticalSpacing="10dp"

android:horizontalSpacing="10dp"

android:stretchMode="columnWidth"

android:gravity="center"/>

这是我用于网格的每个“单元格”中的实际项目的布局:

android:layout_width="match_parent"

android:layout_height="match_parent">

android:id="@+id/cardInGrid"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:gravity="center"

android:singleLine="true"

android:textSize="40sp"

android:textColor="#660099"

android:typeface="serif"/>

我现在在设备上看到以下内容:

有没有办法让GridView中的每个项目更大,所以它适合屏幕的大小,我没有在显示屏底部未使用的空白区域?

这在模拟器上工作正常,但在设备上屏幕分辨率更高,因此在底部获得空白区域.

非常感谢

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值