GridView控件不能显示图像 [英] GridView cannot show image

查看:205
本文介绍了GridView控件不能显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的所有应用程序的图标,并显示在GridView中的图标。 GridView控件显示得很好,但是当我下滑的GridView的速度非常快向下,有时缺乏两个图标在GridView的。不经常出现这种情况,你可以给我一些建议。

I get all application's icons, and show the icons in GridView. The GridView shows them very well, but when I glides the GridView very fast to downward, sometimes lack of two icons at GridView. This kind of situation not often appears, can you give me some advice.

编辑:这个问题已经被问过,但没有答案。 <一href="http://stackoverflow.com/questions/2947019/scrolling-issues-with-gridview-in-android">Scrolling与GridView控件Android中问题

EDIT : this question have been asked before, but no answers. Scrolling issues with GridView in Android

推荐答案

我已经解决了它,在我的情况,在GridView控件中,我用这些XML来显示图像和文字适配器:

I have solved it, in my situation, in the adapter of GridView that I used these XML to show image and text:

<!--  <LinearLayout android:layout_width="fill_parent"  android:layout_height="18dip"  /> -->
    <LinearLayout
            android:id="@+id/iconBackgroundLinear"
            android:layout_width="54dip"
            android:layout_height="57dip"
            android:gravity="center">

        <ImageView
                android:id="@+id/app_icon"
                android:layout_width="45dip"
                android:layout_height="45dip"
                android:adjustViewBounds="false"
                />
    </LinearLayout>

    <TextView
            android:id="@+id/app_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:paddingTop="2dip"
            android:gravity="center_horizontal"
            android:lines="2"
            />
    </LinearLayout>

关键是机器人:行=2,当我使用机器人:MAXLINE =2,它可能会显示上述错误

The key is android:lines="2", when I am using android:maxline="2" , it may show above mistake.

这篇关于GridView控件不能显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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