优化图库及其适配器
我有一个画廊。这个画廊有很多事情要做,它大大减慢了滚动效果。有谁知道如何优化这样的事情?
我的问题的本质是:如何制作比标准 android 实现更快的布局。渲染脚本? NDK?闪存布局?
请记住,我已经缓存了我的观点。我知道这是一个非常普遍的问题,因此我们将不胜感激。
谢谢。
I have a Gallery. This Gallery has a lot going on in it and it is slowing down the scrolling effect substantially. Does anyone have any idea as to how to optimize something like this?
The essence of my question is this: How can I make layouts that zip substantially faster than their standard android implementations. Renderscript? NDK? Flash layouts?
Keep in mind I am already caching my views. I know this is a very general question so any and all input is appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,缓慢的 UI 是在 UI 线程上执行大量工作的结果。我想您可以仔细检查是否属于这种情况,并考虑将非 UI 相关逻辑抽象为一个或多个不同的主题。例如,您可能希望避免在 UI 线程上从 SD 卡或数据库获取大量资源。在单独的线程中执行此类操作可能会提高响应能力,但结果显然取决于应用程序的具体情况。
Quite often a sluggish UI is the result of doing a lot of work on the UI thread. I suppose you could double check whether this is the case and consider abstracting non-UI related logic into one or more different theads. E.g. you probably want to avoid fetching large amounts of resources from the SD card or a database on the UI thread. Doing such actions in seperate thread might improve responsiveness, although results will obviously depend on the particulars of your app.
好吧,这是我观看该视频的前几分钟发现的内容:
http://www.youtube.com/watch?v=v9S5EO7CLjo
我正在构建我的3.1 上的应用程序。在 Manifest 的 application 标签中,添加以下属性:android:hardwareAccelerated="true"。 UI 性能的差异是惊人的。为 Google 对 Android SDK 的这一新增功能点赞。
Okay here is what I found from watching just the first several minutes of this video:
http://www.youtube.com/watch?v=v9S5EO7CLjo
I am building my app on 3.1. In the application tag of the Manifest, add the following as an attribute: android:hardwareAccelerated="true". The difference in UI performance is amazing. Thumbs up to Google for this addition to the Android SDK.