GridView 未拉伸到所有屏幕

发布于 2024-11-29 05:16:42 字数 693 浏览 3 评论 0原文

我有一个 GridView ,它连续显示 2 个图像。我有 SGS 和 Galaxy 5 来测试该应用程序。不幸的是,它的扩展性不好。我更改了 XML 中的值属性以填充 SGS 的屏幕,当我在 Galaxy 5 中测试时,情况很糟糕,非常糟糕。我不知道该怎么办。 请尝试帮助我,GridView 是我启动其他活动的主要布局。 XML:

<?xml version="1.0" encoding="utf-8"?>
<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:columnWidth="90dp"
    android:numColumns="2"
    android:verticalSpacing="20dp"
    android:horizontalSpacing="20dp"
    android:stretchMode="columnWidth"
    android:gravity="center"
    android:background="@drawable/background3"

/>

I have a GridView that is showing 2 images on a row. I have an SGS and Galaxy 5 to test the app. Unfortunately, it's not well scaling. I change values attributes in XML to fill the screen of SGS and when i test in Galaxy 5 it's bad, very bad. I don't know what to do.
Please try to help me, the GridView is my main layout that launches other activities.
XML:

<?xml version="1.0" encoding="utf-8"?>
<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:columnWidth="90dp"
    android:numColumns="2"
    android:verticalSpacing="20dp"
    android:horizontalSpacing="20dp"
    android:stretchMode="columnWidth"
    android:gravity="center"
    android:background="@drawable/background3"

/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文