0

I my application i have to count cell height dynamically and i support iOS7 and iOS8 for my app. I'm following Ray wenderlich tutorial for this purpose. After spending a whole day on this i came to know that this technique only works if size classes are disabled for the app.

So my question is how to calculate row height using auto layout(constraints) if size classes are enabled?

4

2 回答 2

0

当您在应用程序中使用约束时,自动高度计算仅适用于 IOS 8 及更高版本。它不依赖于size classes. 您也可以Constraint在没有尺寸等级的情况下使用。 检查那个链接

谢谢

于 2015-07-13T05:43:41.853 回答
0

您可以尝试将行高设置为UITableViewAutomaticDimensionin viewDidLoad(但我认为它不适用于 iOS 7)

self.tableView.estimatedRowHeight = 44; // need to calculate against something
self.tableView.rowHeight = UITableViewAutomaticDimension;
于 2015-07-13T07:24:13.340 回答