当我们有 UICollectionView 时,我们应该使用 UITableView 吗? [英] Should we use UITableView when we have UICollectionView?

查看:62
本文介绍了当我们有 UICollectionView 时,我们应该使用 UITableView 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用过 UICollectionView 和 UITableView 及其微不足道的使 UICollectionView 看起来像表格.更重要的是使用模式非常相似,你不必学习很多新东西来使用它.

I have worked with both UICollectionView and UITableView and its trivial to make UICollectionView look like table. What is more usage patterns are very similar, you don't have to learn a lot of new stuff to use it.

问题是使用 UITableView 而不是 UICollectionView 有什么论据吗?或者我们可以切换到 UICollectionView 而忘记 UITableView?

The question is are there any arguments for using UITableView and not UICollectionView? Or we can just switch to UICollectionView and forget about UITableView?

推荐答案

我不这么认为.

例如,如果您想要一些即时贴标头,您必须为您的 UICollectionView 创建自定义布局,而使用 UITableView 则非常容易.

For example, if you want to have some stickies header, you've got to create a custom Layout for your UICollectionView, whereas, it's really easy with UITableView.

此外,您还有 plaingrouptableViews,这非常有用.

Moreover you have plain and grouptableViews, which is really usefull.

在我个人看来,我会说有时最好是相互化并使用 collectionView(例如,如果它是 iPhone 上的 tableview 和 iPad 上的 collectionView),但不是每次都如此.

In my own opinion, I would say sometimes it's better to mutualize and use a collectionView (if it's a tableview on iPhone and a collectionView on iPad for instance), but not everytime.

这篇关于当我们有 UICollectionView 时,我们应该使用 UITableView 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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