(iOS版8故事板) 我有我的tableView的权利细节的UITableViewCell。动态的UITableViewCell高度不工作
在故事板标题和右详细的标签设置为numberoflines = 0
我的代码:
- (void)viewDidLoad {
[super viewDidLoad];
keyArray = [[NSMutableArray alloc]init];
self.table.estimatedRowHeight = 140.0;
self.table.rowHeight = UITableViewAutomaticDimension;
[spinner startAnimating];
[self cleanJson:prunedDictionary];
}
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewAutomaticDimension;
}
- (CGFloat) tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(nonnull NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}
在cleanJson结束时,我跑[self.table reloadData]
。 TableViewCell调整大小,但他们都调整大小相同的大小,它看起来像默认大小。 (我知道他们调整的原因是因为在故事板我将高度设置为200,他们都调整为更小的尺寸,当应用程序运行)
他们为什么不正确调整?
你的约束可能是错误的。你能以某种方式将它们添加到你的问题吗? –
@d。费尔伯没有限制,因为我提到,它不是一个自定义单元格。所以它已经有限制,据我所知 – huddie96