Blane Townsend
Blane Townsend

Reputation: 3038

How to make a UITable with columns?

I was wondering how to make a UITable have columns. Or, is there a better way to create an actual table that looks like a grid. I want to have 3 columns. How can I do this?

Upvotes: 0

Views: 490

Answers (2)

idz
idz

Reputation: 12988

If you don't mind the fact that you cannot scroll horizontally you can just use a custom UITableViewCell to give the illusion of columns. If you really want columns (like a spreadsheet) you need to subclass UIScrollView and implement UITableView-like view caching. Luckily Apple has some sample code which shows how to do this, see TiledScrollView.m

Upvotes: 0

Andy Ibanez
Andy Ibanez

Reputation: 12254

The UITableView doesn't have support for more than one column. However, this can be easily fixed if you create your own custom UITableViewCell-s. You would need to stash three different views into the cell and then add whatever you want in them.

Upvotes: 3

Related Questions