我获取所有应用程序的图标,并在GrIDVIEw中显示图标. GrIDVIEw非常好地展示了它们,但是当我将GrIDVIEw非常快地向下滑动时,GrIDVIEw上有时缺少两个图标.这种情况不常出现,你能不能给我一些建议.
编辑:此问题之前已被问过,但没有答案. Scrolling issues with GridView in Android
解决方法:
在我的情况下,我已经解决了它,在GrIDVIEw的适配器中,我使用这些XML来显示图像和文本:
<!-- <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>
关键是androID:lines =“2”,当我使用androID:maxline =“2”时,它可能显示错误.
总结以上是内存溢出为你收集整理的android – GridView无法显示图像全部内容,希望文章能够帮你解决android – GridView无法显示图像所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)