UITableViewAutomaticDimension在Xcode 6.3中不起作用 [英] UITableViewAutomaticDimension not working in Xcode 6.3

查看:104
本文介绍了UITableViewAutomaticDimension在Xcode 6.3中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的Xcode和Swift 1.2一起更新到了6.3,然后进行了转换.

I updated my Xcode to 6.3 along with Swift 1.2, and I made the transition.

除表格视图的动态行高以外,所有其他功能均有效.我在3个完全不同的表视图上使用了它们,因此可能不是其他影响该错误的东西.

Everything works except dynamic row height for table view. I have those on 3 completely different table views, so it probably isn't something else influencing the bug.

我将所有表视图设置为:

I set all of the table views to:

tableView.rowHeight = UITableViewAutomaticDimension

我的所有xib文件都受到适当的约束.

and all of my xib files are properly constrained.

有什么想法吗?

推荐答案

我也只是将UITableViewAutomaticDimension添加到了估计的行索引路径中.您可以在 BEAM应用(在人员"类别下)中查看其工作方式.

I simply added UITableViewAutomaticDimension to estimatedrowforindexpath as well. You can see how it works on the BEAM App (under 'people' category).

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewAutomaticDimension;
}

- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewAutomaticDimension;
}

这篇关于UITableViewAutomaticDimension在Xcode 6.3中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆