iPhone how i can I do multiple columns in UITableView/UIImageView
How I can implement the following screen.
What are ui controls can be used for implementation the same开发者_开发技巧 grid behavior? I'm seeing UITableView, but it doesn't support multi columns. How can be?
Thanks, Anatoly
How about a UITableViewCell
with three (if you count the stars it'll make six) UIImageView
s and three UILabel
s?
You could put three UIImageViews and three UILabels below the images per cell.
Here's a tutorial on how to draw grids in a UITableView.
But for your case I'd do it with interface builder for a custom UITableViewCell:
Basing from your requirements, I think you should use AQGridView,
I found it here: https://github.com/AlanQuatermain/AQGridView You can download the sample code.
I've downloaded the sample code and run it on my iPad 5.0 Simulator, here is the screenshot:
and what amazed me most is that when you switch your device to landscape mode, it automatically displays the images in four columns (to utilize the space):
I hope this helps.
Customizing UITableViewCell to contain many cells inside and rendering each cell as needed.
Anyway, it's not a good practice to do that in your controller. You should build an external control to handle it.
Please take a look at my UIGridView. It uses the explained technique and produce the result that you want.
Here is the screenshot:
精彩评论