Horizo​​ntalScrollView自定义适配器? [英] HorizontalScrollView custom adapter?

查看:490
本文介绍了Horizo​​ntalScrollView自定义适配器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让使用Horizo​​ntalScrollView图库部件,所以Horizo​​ntalScrollView里面我加ImageViews,问题是,我要加600 +的图像!结果
我可以做出某种自定义适配器,以覆盖GetView方法,并利用co​​nvertView为了使应用程序更顺畅,避免在同一时间增加600多意见?

I'm trying to make a Gallery widget using HorizontalScrollView, So inside the HorizontalScrollView I add ImageViews, and the problem is that I'm going to add 600+ images!
Can I make some kind of a custom adapter in order to override the GetView method and utilize convertView in order to make the app smoother and avoid adding 600+ views at the same time?

推荐答案

Horizo​​ntalScrollView只能包含一个视图,所以你要你画绘制它的任何部分的整体视图随时随地。这可能,但是,围绕由

HorizontalScrollView can contain only one View, so you have to draw that whole View anytime you are drawing any part of it. This could, however, be worked around by


  1. 扩展的ViewGroup作为Horizo​​ntalScrollView的孩子

  2. 使用在你的ViewGroup自定义适配器,并调用getView(),并在自己的回收,仅绘制当前在您的Horizo​​ntalScrollView可见视图

但是,这会,如果你的时间走了很多。我想至少尝试像<一个href=\"https://github.com/dinocore1/DevsmartLib-Android/tree/master/devsmartlib/src/com/devsmart/android/ui\">HorizontalListView第一。如何 - 对特定类别可以发现这里

But this would take a lot if your time. I'd at least try something like HorizontalListView first. A how-to of that specific class can be found here.

这篇关于Horizo​​ntalScrollView自定义适配器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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