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
I would suggest using a
UITableViewwith a customUITableViewCellsubclass. You could do it with aUIScrollViewdirectly, 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
UIViewsubclass to draw the icon and label (cleaner), or draw them directly to the cell’s view using the drawing primitives (faster).