views:

254

answers:

2

I am trying to create a custom table cell that has multiple labels. I already have code to create a custom cell. My problem is, it is just not that pretty. What I need is some pointers on how to apply multiple labels each of which may be a different color, font, etc.

These are the labels I would like to include and they should appear centered one after another.

a.) Name b.) Address1 c.) Address2 d.) Phone

Any pointers or links to examples greatly appreciated.

A: 

You need to create a custom cell with the labels on them however you desire. It can easily be done, and I have done it before. It's not really hard, Apple has sample code on creating custom cells available on the portal that you should have a look at if you can't envision how to do this.

jer
Yes, I am already creating custom cells but they aren't much to look at. I need some pointers on creating the labels that I will apply to the custom cell. Sorry, if that wasn't clear in my post.
butchcowboy
A: 

Is this what you wanted? Replace cell with self if it is in a UITableViewCell subclass...

UILabel *name = [[UILabel alloc] initWithFrame:whatever];
[name setText:@"something"];
[cell addSubview:name];
chpwn
That is the basic idea. However, I need multiple labels.
butchcowboy
Then do that multiple times with different variable names and different frames.
chpwn