views:

67

answers:

1

The iPhone shows applications icons, with the application name below ea. icon, on the screen 4 across and 4 down.

What is the best way to replicate this type of view in a custom iPhone application?

For example, I'd like to show a grid of players in a game I'm developing in a UIScrollView that shows a thumbnail of each player and their name. I'd like to show a maximum of 4 such "cells" per row and just keep on generating rows as needed based on player count (e.g. given 10 players I'd have 3 rows ... the first two would have 4 player thumbs and the last would have 2).

Is there a custom UIViewController for something like this perhaps?

Thanks

A: 

I would suggest using a UITableView with a custom UITableViewCell subclass. You could do it with a UIScrollView directly, but the table view implements some cell-reusing behavior that you'll probably want to utilize.

Depending on whether the performance on the device is acceptable you could either create a custom UIView subclass to draw the icon and label (cleaner), or draw them directly to the cell's view using the drawing primitives (faster).

Frank Schmitt
What is strange to me is that the UITableViewCell represents an entire row ... not really "just" a cell per se. I'm trying to create a table with 4 cells per row, each representing an player and providing the behavior to be selected/un-selected, etc...
wgpubs