我获取所有应用程序的图标,并在 GridView 中显示图标。 GridView 很好地显示了它们,但是当我非常快地向下滑动 GridView 时,有时 GridView 缺少两个图标。这种情况不常出现,您能给我一些建议吗?
EDIT :这个问题以前曾被问过,但没有答案。Android 中 GridView 的滚动问题
在我的情况下,我已经在 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>
关键是安卓:行=“2”,当我使用机器人:最大行=“2”,可能会出现上面的错误。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)