Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grid view in iOS [closed]

I would like to create a grid view in my iPhone app similar to that shown in the iPad photos app. Is there a library or framework available for adding this kind of functionality (non-SDK)? Ideally I would like to eventually develop an iPad version of the app, where the grid would be 3 items wide in portrait and 4 in landscape, however for the time being I would like 2 items wide in portrait and 3 wide in landscape.

The only way I can think of doing this is by subclassing UITableView and having a custom cell that creates the 2 or 3 items. This however seems messy and I am sure that there is a better way.

A typical item will have a picture, label and button - nothing too complicated.

like image 872
Jack Avatar asked Feb 15 '10 10:02

Jack


People also ask

How do I change my Apple Watch from list view to grid view?

On your Apple Watch, press the Digital Crown to go to the Home Screen. If the screen is in list view, touch and hold the Home Screen, then tap Grid View.

How do you get the grid on FaceTime?

In a FaceTime call, tap the Grid button near the upper-right corner of the screen (if the button isn't visible, tap the screen). To turn the Grid off, tap it again.

Why does my Apple Watch say grid view?

Grid view shows your app icons in a honeycomb layout that you can navigate with your finger. List view shows apps in alphabetical order which you can scroll through using the Digital Crown. We'll show you how to set your Apple Watch apps to list view or grid view, according to your preference.


2 Answers

For iOS 6 and above I recommend UICollectionView and PSTCollectionView.

The goal is to use PSTCollectionView on iOS 4/5 as a fallback and switch to UICollectionView on iOS6. We even use certain runtime tricks to create UICollectionView at runtime for older versions of iOS. Ideally, you just link the files and everything works on older systems.

In the year 2010 I recommended AQGridView

like image 185
catlan Avatar answered Sep 22 '22 13:09

catlan


I'm aware this is very old but I was searching for answer to this and tested several solutions. I found GMGridView was one of the best, least buggy solutions. Check it out at https://github.com/gmoledina/GMGridView.

like image 38
morcutt Avatar answered Sep 20 '22 13:09

morcutt