UICollectionView VS UITableview

前端 未结 2 1145
死守一世寂寞
死守一世寂寞 2020-12-30 02:37

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 researching the UI mechani

相关标签:
2条回答
  • 2020-12-30 03:29

    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.

    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).

    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.

    0 讨论(0)
  • 2020-12-30 03:34

    It's slightly unclear what you're asking, so I have summerized the advantages of both.

    UITableView

    UITableView is the base mechanism for displaying sets of data on iOS. It's a simple list, which displays single-dimensional rows of data. It's smooth because of cell reuse and other magic.

    UICollectionView

    UICollectionView is the model for displaying multidimensional data - it was introduced just a year or two ago with iOS 6, I believe.

    It's also smooth because of the same tactics used in UITableView - cell reuse, etc.

    0 讨论(0)
提交回复
热议问题