Creating a grid view on iOS

后端 未结 5 1817
梦谈多话
梦谈多话 2021-02-01 08:54

I need to implement a grid view with dynamically-changing images.

Most of the time, I use a UITableView to create a grid, but I run into memory issues if I

相关标签:
5条回答
  • 2021-02-01 09:06

    I would go with UICollectionView as you said. You can actually see this answer I gave, where you can see already made libraries.

    0 讨论(0)
  • 2021-02-01 09:10

    Late to the party, but we have opensourced our commercial datagrid component and its free to use!

    https://github.com/flexicious/iOSDataGrid

    Its actually quite versatile in what it can do as compared to most libraries listed above.

    http://www.ioscomponents.com/Home/IOSDataGrid

    0 讨论(0)
  • 2021-02-01 09:14

    I would go with a UICollection view. Since you've never used one, here is a good tutorial to follow: http://www.raywenderlich.com/22324/beginning-uicollectionview-in-ios-6-part-12.

    0 讨论(0)
  • 2021-02-01 09:16

    UICollectionView is available in iOS 6.0 and later, so it can't be used if you want to support earlier versions.

    There are quite a open-source libraries that let you create grid views:

    • KKGridView
    • UIGridView
    • AQGridView
    • NRGridView
    • MMGridView
    • WCGridView

    I am currently using AQGridView, and I've found it to be the most robust. It works just like a UITableView. Evadne Wu created a video and sample project showing how to use it.

    Also, if you're trying to do this without using Interface Builder, keep in mind that it'll be a bit more difficult since you have to create the views programmatically.

    0 讨论(0)
  • 2021-02-01 09:22

    I have used PSTCollectionView and it backwards compatible with iOS 5 and iOS 4.3. UICollectionView is iOS6+ only. It virtually has the same API as UICollectionView.

    GMGridView is also a popular choice for creating grid views.

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