GridView not stretching to all screens

可紊 提交于 2019-12-11 07:40:04

问题


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"

/>

回答1:


Did you tried android:scaleType="fitXY" ?

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



来源:https://stackoverflow.com/questions/7053016/gridview-not-stretching-to-all-screens

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!