回收水平滚动型机器人内部意见 [英] Recycling views inside a horizontal scrollview android
问题描述
我正在用相当复杂的用户界面的应用程序。它媲美扩展到viewpager上被点击一个水平列表视图。 presently,我用最基本的做法已经实现这一点。我只是里面充气意见 horizontalScrollView
,每当用户点击任何父视图充气动画另一个子视图。
这工作完全正常,并给它一看水平的扩展列表视图中。不过,我觉得这种做法是非常低效的,因为我不断获取GC警告几乎每隔几秒钟,从而降低性能。而且在这个方法我还没有循环的竞争观点如列表视图
一样。
我的问题是:
- 是否有这样做的任何其他有效的方式?
- 怎么可能我在现有的code一样的ListView回收的观点呢?
谢谢!
(请不建议使用画廊。我的观点是相当复杂的)
是否有这样做的任何其他有效的方式?
块引用>使用
ViewPager
或开源HorizontalListView
,它们都使用适配器模式。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 sourceHorizontalListView
, both of which use the adapter pattern.这篇关于回收水平滚动型机器人内部意见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!