UICollectionView VS UITableview [英] UICollectionView VS UITableview

查看:153
本文介绍了UICollectionView VS UITableview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,它将显示超过1000个项目,所有这些项目详细信息都是本地的(通过coredaata保存)并将随应用程序一起提供。

I have an app which will show over a 1000 items, all of those item details are local ( saved via coredaata) and will ship with the app.

In研究用于显示这些项目的UI机制,我在选择uicollectionview或tableviewcontroller与自定义单元格之间。
我的问题是:哪个选择效率更高,并且在
拖动方面提供更流畅的用户界面?
哪一个我可以自定义加载我只有足够的1000个条目提供平滑滚动,并根据需要加载更多单元格?

In researching the UI mechanisms to show those items, I am in between choosing uicollectionview or tableviewcontroller with a customized cell. My question is : Which choice would be more efficient and provide a smoother UI in terms of dragging? which one can I customize to load out the 1000 entries I have only enough the provide a smooth scroll, and load more cells as needed?

谢谢。

推荐答案

如果您遵循视图/单元重用的良好实践,这两种方法都可以轻松处理1000个条目。另外两个API非常相似,所以从一个API跳到另一个并不是那么难。

Both approachs will handle 1000 entries easily if you follow the good practices of view/cell reusing. Additionally both APIs are very similar, so jumping from one to the other is not that hard.

两者之间的主要区别在于你想要如何显示这1000个项目。 UITableView 有几种样式的单元格堆叠在一起。你不应该试图弯曲它做任何其他类型的事情比那种布局复杂得多。 UICollectionView 是一组功能更强大的类,它们几乎可以修改数据在屏幕中的显示方式,特别是其布局,以及其他内容。您几乎可以在每个iOS应用程序(例如Contacts或iPod)中看到 UITableViews ,而 UICollectionViews 则更难以看到(照片中的网格,还有iPod中的封面流)。

The main difference between the two is how you want to display those 1000 items. UITableView has a couple of styles of cells stacked one over the other. You should not try to bend it to do any other kind of things too much complex than that kind of layout. UICollectionView is a much more powerful set of classes that allow to modify almost every aspect of how your data will appear in screen, specially its layout, but also other things. You can see UITableViews in almost every iOS application (for example Contacts or iPod), while UICollectionViews are more difficult to see (the grid in Photos, but also the coverflow in iPod).

因此,如果您需要像iOS中的大多数表视图那样的标准,我会选择 UITableView ,但如果您需要更多控制布局,请使用 UICollectionView

So, if you need something standard like most table views in iOS I will choose the UITableView, but if you need more control over your layout, go with UICollectionView.

这篇关于UICollectionView VS UITableview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆