iphone - 使用UITableViewCellStyleValue1时如何防止textLabel被截断?

标签 iphone uitableview textlabel

当将 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/

相关文章:

ios - Xcode - 更改 UITableViewCell 上的标签数据

iphone - 手动使用 CoreGraphics 绘制阴影?

ios - 无法在 Swift 中将类型 'UITableViewCell' 的值转换为 'NSIndexPath'

ios - 使用一个 NSFetchedResultController 获取多个实体及其之间的关系

ios - UITableView 中的第一部分从来​​没有正确的内容

iphone - UITableViewCell textLabel 宽度大小错误 Expression is not assignable

iOS 为什么在设置 NSBaselineOffsetAttributeName 时 NSTextAttachment 会消失?

ios - 自动续订订阅是否需要恢复按钮?

iphone - 如何禁用 UITextField 或键盘的文本自动更正?