开发者

Multiple images per row in UITableView's cell

Is there any sample code that would illustrate how to have multiple images within each row?

Typical apps show a thumbnail to th开发者_StackOverflow中文版e left side with text to the right. I'd like to do that plus an image to the right of the text.

How would I go about doing this?


In interface builder, simply create a tableview cell that looks like you want. Then create a UITableViewCell subclass that has properties pointing to the elements of the new cell. Set the class of cell to the subclass then add cells of that class to the table in the standard way.

A tableview cell is just a view and you modify it and use it just like any other view.


You'll have to create a custom UITableView cell. Here's an example of using multiple UILabels in one. Here's another.


Pretty easy - follow Apple's documentation to create exactly the cell you want in Interface Builder with as many UIImage or whatever else you like. Look at Table View Programming Guide for details on how to make and load the custom cells - just be careful about performance when you put a lot of visual elements in a table view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜