views:

312

answers:

2

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 appearance 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

A: 

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?

mj_
I'm programming on the iPad. And this can't be right, as I've seen other apps use columns...or at the very least, something that looks like columns. Maybe it's just a cell object with two things next to each other...but that doesn't make sense with other things I've seen on the internet. I KNOW I've seen people talk about table views and multiple columns, so I know it exists.
CrystalBlue
I guess if I'd have to choose, I would try to put the images and label into the same cell then.
CrystalBlue
Can you point me to a location where you saw column discussion? I'd like to take a look and then see if I can still help.
mj_
Well, it looks like a lot of the examples actually talk about setting up the cell of the column in IB to have two columns, or two items, and then using that cell as a template for the UITableView. Maybe that's where I need to go. I could have sworn I had seen examples talking about column options in the IB when you select a table...I'll have to keep looking.
CrystalBlue
+1  A: 

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.

codejam
Yeah, this looks like my best bet so far. I'll try that and see how it looks. I just know that this app needs to be very 'looks' oriented. Thanks.
CrystalBlue