2010-06-20 46 views
2

当使用UITableViewCell和UITableViewCellStyleValue1风格时,textTextLabel很长时textLabel.text被截断。如何防止在使用UITableViewCellStyleValue1时截断textLabel?

static NSString *CellIdentifier = @"Cell"; 
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease]; 

cell.textLabel.text = @"Publisher"; 
cell.detailTextLabel.text = @"This Is A Very Long String"; 

所以,问题是如何给力“发布”而不被截断detailTextLabel的regarldess长度要显示?

P.S.我是这个社区的新成员,所以我无法发布可以更好地说明问题的图像。对不起...

回答

3

你试过[cell.detailTextLabel setNumberOfLines:0]; 也许它的工作原理。

+0

不幸的是,没有工作......谢谢你的尝试。 – Joshua 2010-07-17 21:12:17

+0

虽然为我工作。 – nont 2011-01-17 18:46:41

0

如果您正在主动更改单元格的文本,那么它可能会被截断,因为尽管有很多空间,标签仍未展开。您可以在更改文字以修复该特定问题后致电[cell setNeedsLayout]

相关问题