开发者

How to reuse UIViews, the way UITableView does?

开发者 https://www.devze.com 2023-01-21 11:11 出处:网络
I want to create a view that shows vast amounts of data. Using UITableView would have been a good idea except it\'s not the 开发者_JS百科way/style I want to show it. I\'m thinking of creating my own v

I want to create a view that shows vast amounts of data. Using UITableView would have been a good idea except it's not the 开发者_JS百科way/style I want to show it. I'm thinking of creating my own view, and I was wondering: UITableViewCell is constantly being reused through the dequeueReusableCellWithIdentifier method; how does this work? I mean, I can figure out how to cache UIViews, but how does UITableView draws them on the table, allowing them to still be interactive, without keeping the UIViews themselves?

Thanks! Aviad.


Apple's ScrollViewSuite sample code shows how to create a tiled UIScrollView that reuses views very much like a table view. You could use it as a model or starting point.

0

精彩评论

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