当将 UITableViewCell 与 UITableViewCellStyleValue1 样式一起使用时,当detailTextLabel相当长时,textLabel.text将被截断。
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";
所以问题是如何强制显示“Publisher”而不被截断,无论detailTextLabel的长度如何?
附注我是这个社区的新人,所以我无法发布可以更好地澄清问题的图像。抱歉...
最佳答案
您尝试过[cell.detailTextLabel setNumberOfLines:0];
也许它有效。
关于iphone - 使用UITableViewCellStyleValue1时如何防止textLabel被截断?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3081006/