我得到了一些应用程序的表。让我们使cell.textLabel更短
在这个表格中有两个标签 - 带标题的textLabel
和带日期的detailTextLabel
。但是当标题很长时,它显示在detailTextLabel
上。
我该如何解决这个问题?
P.S.
我试图重写这样layoutSubviews
方法:
- (void)layoutSubviews {
[super layoutSubviews];
CGSize size = self.bounds.size;
CGRect frame = CGRectMake(4.0f, 4.0f, size.width, size.height);
self.textLabel.frame = frame;
self.textLabel.contentMode = UIViewContentModeScaleAspectFit;
}
但它不工作
你试试看cell.textLabel.numberOfRows = 1; – Hiren 2012-02-16 07:22:01
如果您的意思是numberOfLines - 它不工作。 – 2012-02-16 07:28:55