English 中文(简体)
编制大量基于库尔斯的适应人员名单的速度比较少的校内适应人员名单要快
原标题:Scrolling large lists of Cursor-based adapters is faster than much smaller lists of in-memory adapters

我有一张有<条码>的灯光/密码>,其基础是<条码>ListView(以斜体为后盾)以及基于“条码”的习惯<条码>的“BaseAdapter。

两种数据都是相同的——一种形象,另一种是<代码>。 原文:<0>。 我的《名单》有3 000个浏览点,根据《个人名单》,约30个。 然而,在库尔斯基的适应者中,缩小名单的速度大大加快。 对于基于JSON的名单上,数据都是在显示各行各行之前的。 这两类名单的图像均按要求下载。

我的两份清单都是相同的,有<代码>fastScrollEnabled、scrollingCachesmoothScrollbar

I m 寻找途径,了解如何试图说明谁在座,并视可能加以固定,以便以JSON为基础的。 ListViews as well as the Cursor-based.

最佳回答

I have a similar thing in my application, except I only have json backed ListView and I also have about 30 items in it (with data constantly changing and animation playing to reflect changes). It would be much more easier to detect a problem with some provided code from your side, but here are couple of tricks you can sue for optimization.

  1. Reuse convertView that is passed to you as one of the parameters in getView method, it really speeds up the scrolling.
  2. Either create your own row view (by extending some layout, or ViewGroup), or use setTag on a row you return form your getView method. In this tag, you should keep an object that contains references to views in that row, so you wont be searching for them with findViewById everytime a row is requested. Object can be a simple static class like

       ImageView image;
       TextView text;
    

    iii

On the first time (when the convertView is null and you need to create a fresh row) you just create instance of your ViewHolder and set those parameters to refer to parameters from your newly created row (by calling findViewById), and put this instance in row s setTag method. Next time, when you reuse convertView, just call getTag and in the tag you recieved you ll get references to views in that row, so you won t be needing to call findViewById anymore.

当然,你可能已经做了所有这些工作。

P.S.,我建议你(如果你已经知道的话)看谷歌一/O有关名单的陈述。 这方面的许多有用信息:

问题回答

暂无回答




相关问题
What to look for in performance analyzer in VS 2008

What to look for in performance analyzer in VS 2008 I am using VS Team system and got the performance wizard and reports going. What benchmarks/process do I use? There is a lot of stuff in the ...

SQL Table Size And Query Performance

We have a number of items coming in from a web service; each item containing an unknown number of properties. We are storing them in a database with the following Schema. Items - ItemID - ...

How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

热门标签