Horizo​​ntalScrollView自定义适配器?

编程入门 行业动态 更新时间:2024-10-25 06:26:25
本文介绍了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

  • 扩展的ViewGroup作为Horizo​​ntalScrollView的孩子
  • 使用在你的ViewGroup自定义适配器,并调用getView(),并在自己的回收,仅绘制当前在您的Horizo​​ntalScrollView可见视图
  • 但是,这会,如果你的时间走了很多。我想至少尝试像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自定义适配器?

    本文发布于:2023-11-26 21:30:34,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1635260.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:自定义   适配器   Horizo   ntalScrollView

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!