【发布时间】:2016-07-11 17:23:42
【问题描述】:
我正在尝试根据系统字体高度更改自定义 tableviewcell 高度。 但是我没有找到任何获取系统字体高度的api。
注意:我无法使用任何单元格标签计算字体高度,因为在配置单元格之前会调用“HeightForRowAtIndexPath”。
请提出解决方案。
【问题讨论】:
-
尝试使用约束并添加两行代码 self.table.estimatedRowHeight = 44.0 ; self.table.rowHeight = UITableViewAutomaticDimension;
-
谢谢@KishoreKumar,但我得到了解决方案,我想检查字体高度,这里是解决方案:UIFont preferredFontForTextStyle:UIFontTextStyleBody].lineHeight
标签: ios cocoa-touch ios7 ios8 ios9