GridView控件没有延伸到所有屏幕 [英] GridView not stretching to all screens

查看:150
本文介绍了GridView控件没有延伸到所有屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GridView控件即显示在连续2个图像。我有一个SGS和Galaxy 5测试应用程序。不幸的是,它没有很好地进行缩放。我更改值在XML属性,以填补S​​GS的屏幕,当我在银河5测试它的坏,很不好。我不知道该怎么办。
请尽量帮我时, GridView控件是启动其他活动,我的主要版面。
XML:

 <?XML版本=1.0编码=UTF-8&GT?;
< GridView控件的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:ID =@ + ID / GridView控件
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT
    机器人:columnWidth时=90dp
    机器人:为numColumns =2
    机器人:verticalSpacing =20dp
    机器人:horizo​​ntalSpacing =20dp
    机器人:stretchMode =columnWidth时
    机器人:比重=中心
    机器人:背景=@绘制/ background3/>


解决方案

你有没有试过的android:scaleType =fitXY

http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

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"

/>

解决方案

Did you tried android:scaleType="fitXY" ?

http://developer.android.com/reference/android/widget/ImageView.ScaleType.html

这篇关于GridView控件没有延伸到所有屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆