Iphone TableViewCell文本标签宽度问题

Iphone TableViewCell文本标签宽度问题,iphone,Iphone,如何限制aCell.textlab和aCell.detailtextlab的宽度。我在textLabel中有一个大字符串,它覆盖在我的细节字符串上。我试过这个: aCell.textlab.width=aCell.width-250;但它不起作用。任何线索。我不确定这是否是最佳答案,但您可以尝试在interface builder中创建自定义的UITableViewCell。这就是我上次做的,我必须做任何不寻常的事,以表细胞 UILabel *theTitle = [[[UILabel allo

如何限制aCell.textlab和aCell.detailtextlab的宽度。我在textLabel中有一个大字符串,它覆盖在我的细节字符串上。我试过这个:
aCell.textlab.width=aCell.width-250;但它不起作用。任何线索。

我不确定这是否是最佳答案,但您可以尝试在interface builder中创建自定义的
UITableViewCell
。这就是我上次做的,我必须做任何不寻常的事,以表细胞

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];
DarkDust刚刚在另一个问题中发布了本教程:
我是这样做的:

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];