2

I know in iOS6 there is the new collection view which would allow me to create a sort of table view with multiple columns or effectively a grid view.

I am looking to achieve the same effect but on iOS5 and some guidance would be appreciated.

So I want to create a grid of "cells" 4 across so very much like how the photos work on iOS when you view an album.

My first thought is to use Monotouch.dialog and create a Element that takes in a uiview that contains the 4 uivew "cells"

or to just add the cells to a scrollview programtically calculating their position into 4x(max) grid

the grid will be built off a dynamic list of data so it could contain a large amount of cells so Im trying to pick the best preforming method. Would anyone have any suggestions?

JonBull2013
  • 315
  • 1
  • 3
  • 9

1 Answers1

2

In the past I have just made a custom UITableViewCell with 4 buttons (or as many columns as you need), and then manually setup UITableView and UITableViewSource.

You would of course, have to do the math for the number of rows:

(int)Math.Ceiling (yourListOrArray.Count / 4d)

And you'd have to write the same line of code over and over to set up each column.

It is annoying, but works well for me, make sure to take advantage of UITableView's ability to reuse rows.

jonathanpeppers
  • 26,115
  • 21
  • 99
  • 182