Adnan Khan
Adnan Khan

Reputation: 917

How i can create grid on iphone which have multiple coloumns?

enter image description here

How i can create grid which can have multiple coloums in iphone as shown in given image, please suggest me.

Upvotes: 3

Views: 1459

Answers (3)

DharaParekh
DharaParekh

Reputation: 1730

use UITableView and 'UITableViewCell'

Editing:

  1. Create UITableView in particular View
  2. delegate and datasource to uitableview
  3. take custome uitableviewcell
  4. write following delegate and datasource method

    • (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    • (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section;
    • (CGFloat)tableView:(UITableView *)aTableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
    • (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Upvotes: 0

Nishant B
Nishant B

Reputation: 2897

As there is now control introduced by Apple in iOS 6, you can use that "UICollectionView" control.

But my suggestion is,

You can go with custom "UITableViewCell".

In that, you can create the tableview cell as per your need, make IBOutlet and IBAction of objects and inside the "CellForRowAtIndexPath", use that all controls and bind methods.

You can easily achieve the grid as per your need. May be you need to design screen Horizontally (Landscape).

Happy Coding!

Cheers!

Upvotes: 0

Egor Chiglintsev
Egor Chiglintsev

Reputation: 1252

Apple introduced UICollectionView in iOS 6 which could be used for this purpose.

Or alternativaly you could use a standard UITableView with custom cells which display multiple columns. So you'll have to make a UITableViewCell subclass which will contain all the UI needed to display a single row of your table.

Upvotes: 1

Related Questions