We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//解决办法就是在获取高度之后判断一下,是否为空,如果为空的话,那就用cell的高度设置一下就可以了。 CGSize fittingSize = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize]; if (fittingSize.height == 0) { fittingSize.height = cell.frame.size.height; }
The text was updated successfully, but these errors were encountered:
1.2 版本还不支持非 auto layout 的布局方式,且约束连的不对时会返回 0 让开发者注意约束的错误,不过新版本中对于 frame 布局的 cell 增加了 -sizeThatFits:的调用,重载这个方法后可以返回希望的高度。你所说的 fittingSize.height = cell.frame.size.height; 并不能解决问题,因为 template layout cell 只是为了计算,不会显示到屏幕上,且计算的结果也不会设置给这个 cell。请留意接下来新版本的更新,谢谢。
-sizeThatFits:
fittingSize.height = cell.frame.size.height;
Sorry, something went wrong.
Fixed in 1.3
No branches or pull requests
//解决办法就是在获取高度之后判断一下,是否为空,如果为空的话,那就用cell的高度设置一下就可以了。
CGSize fittingSize = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize];
if (fittingSize.height == 0) {
fittingSize.height = cell.frame.size.height;
}
The text was updated successfully, but these errors were encountered: