回收水平滚动型机器人内部意见 [英] Recycling views inside a horizontal scrollview android

查看:202
本文介绍了回收水平滚动型机器人内部意见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用相当复杂的用户界面的应用程序。它媲美扩展到viewpager上被点击一个水平列表视图。 presently,我用最基本的做法已经实现这一点。我只是里面充气意见 horizo​​ntalScrollView ,每当用户点击任何父视图充气动画另一个子视图。

这工作完全正常,并给它一看水平的扩展列表视图中。不过,我觉得这种做法是非常低效的,因为我不断获取GC警告几乎每隔几秒钟,从而降低性能。而且在这个方法我还没有循环的竞争观点如列表视图一样。

我的问题是:


  • 是否有这样做的任何其他有效的方式?

  • 怎么可能我在现有的code一样的ListView回收的观点呢?

谢谢!

(请不建议使用画廊。我的观点是相当复杂的)


解决方案

  

是否有这样做的任何其他有效的方式?


使用 ViewPager 或开源 Horizo​​ntalListView ,它们都使用适配器模式。

I'm making an app with fairly complex UI. Its comparable to a horizontal list view that expands to a viewpager on being clicked. Presently, I've implemented this using the most basic approach. I simply inflate views inside a horizontalScrollView and inflate another subview with animation whenever user taps on any parent view.

This works perfectly fine and gives it a look of horizontal expandable listview. However, I feel this approach is highly inefficient since I keep on getting GC warnings almost every few seconds thereby reducing performance. And in this approach I'm not even recyling views like listview does.

My questions are:

  • Is there any other efficient way of doing this ?
  • How could I recycle views in my existing code like listview does?

Thanks!

(Please don't recommend using Gallery. My view is fairly complex)

解决方案

Is there any other efficient way of doing this ?

Use ViewPager or the open source HorizontalListView, both of which use the adapter pattern.

这篇关于回收水平滚动型机器人内部意见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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