I haven't found a good answer to this, and I must be dense, but...
I'm trying to get a table view set up with an image and a label in each row. The image would be an indicator image (New, In Progress, Stopped, Finished, ect.) and the label would be a particular issue name.
I can set up the table view normally with one column, but I can't find anything (in the code or in the Interface Builder) that sets the number of columns for a table. I assume I would have to set up two columns for the table.
After that, I also need help on how I add the image to the first column and add the label to the second column. Basically, I want the same functionality and a开发者_如何学Cppearance you get from the iPhone's native Photo Album app, which shows a thumbnail on the left and a label in the center. And please treat me like I'm stupid, as I've searched all over, and everyone on the internet seems to have an option in the IB for table views that sets the number of columns...everyone but me. :P
Your best course of action is to create your own custom UITableViewCell and specifically design it to include an image and a text label. Anything beyond that means you're going to have to start subclassing UITableView which isn't for the faint of heart. Another option is to look into a 3rd party library such as AQGridView.
There's no such thing as a column in UITableViews. There's one of 2 routes that come to mind right off the bat.
1) Use 2 UITableViews that are side-by-side and sync'ed with one another whenever one moves (this may look a little weird)
2) Stuff the label and the image into the same cell of the UITableView.
What's your choice?
One more thing - are you programming for iPhone, iPad?
If you just want an image and a label set your tableview cell's style to UITableViewCellStyleDefault add your image to the cell's image view.
See: http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/TableView_iPhone/TableViewStyles/TableViewCharacteristics.html#//apple_ref/doc/uid/TP40007451-CH3-SW14
and
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html#//apple_ref/c/econst/UITableViewCellStyleDefault
精彩评论