开发者

How to speedup & make the cells smooth scrolling in iPhone?

开发者 https://www.devze.com 2023-01-18 10:20 出处:网络
i did a text rendering program using UIView and UITableViewController. What i did is before going drawRect method, i just calculate all of the cells height as well as each text start & height,widt

i did a text rendering program using UIView and UITableViewController. What i did is before going drawRect method, i just calculate all of the cells height as well as each text start & height,width. So that, i can estimate the cell height approximately and then i draw the text.

I did this for both portrait & landscape mode. My program looks like twitter updates. When the user changed to landscape mode i calculated the same things for landscape mode. Next time, i simply retrieve the stored data for drawing text(Valid before application quits).

Now my problem开发者_如何转开发 is, when my inputs are less, it works good. But for the huge input say 100 inputs, it takes some time to show the text. Also, my program's scrolling is somewhat not smooth. Also there is no leak in my application.

Please anyone suggest me the good way to do this application and make it so smooth and faster...

Thanks in Advance, Rajkanth


The short answer to this is to minimize any computation you do in rendering of the cells. This includes any transparent backgrounds. To achieve the fastest scrolling, ideally you would have very few amounts of non-opaque elements.


The trick is to only have one big opaque element by coalescing all your individual elements into a single view.

http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/

0

精彩评论

暂无评论...
验证码 换一张
取 消