我将我的Xcode和Swift 1.2一起更新到了6.3,并进行了转换。
除了表格视图的动态行高之外,所有的东西都可以工作。我把它们放在3个完全不同的表视图上,所以这可能不是其他影响bug的东西。
我将所有的表视图设置为:
tableView.rowHeight = UITableViewAutomaticDimension并且我所有的xib文件都受到了适当的约束。
有什么想法吗?
发布于 2015-04-11 01:02:29
我只是简单地将UITableViewAutomaticDimension添加到I的估计行中。你可以在BEAM App上看到它是如何工作的(在“人物”类别下)。
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
return UITableViewAutomaticDimension;
}发布于 2016-06-27 20:24:16
需要提供估计的行高。
除非必要,否则最好不要实现estimatedHeightForRowAtIndexPath:。
如果你能想出一个值,estimatedRowHeight会更便宜
tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 30 //Provide any appropriate valuehttps://stackoverflow.com/questions/29565078
复制相似问题