2010-10-13 34 views
1

如何限制我的aCell.textLabel和aCell.detailTextLabel的寬度。我在textLabel中有一個大字符串,它覆蓋在我的詳細信息字符串上。我試過這個: aCell.textLabel.width = aCell.width - 250;但它不起作用。任何線索。TableViewCell textLabel寬度問題

回答

1

我就是這麼做的:

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