tags:

views:

29

answers:

2

How can I restrict the width of my aCell.textLabel and aCell.detailTextLabel. I have a big string in textLabel which is overlaying on my detail string. I tried this: aCell.textLabel.width = aCell.width - 250; but it is not working. Any clue.

+1  A: 

I'm not sure if this is the best answer, but you might try creating a custom UITableViewCell in interface builder. That's what i did last time I had to do anything unusual to a table cell.

DarkDust just posted this tutorial in another question: http://www.e-string.com/content/custom-uitableviewcells-interface-builder

Nimrod
+1  A: 

I did it this way:
UILabel *theTitle = [[[UILabel alloc] initWithFrame:CGRectMake(10, 10, 200, 25)] autorelease];
[theTitle setText:[anObject objectForKey:@"key"];
[theTitle setFont:[UIFont fontWithName:[self textLabelFont] size:[[self textLabelFontSize] floatValue]]];
[aCell.contentView addSubview:theTitle];

Abhinav