【问题标题】:How to get dynamically changed font height?如何获得动态更改的字体高度?
【发布时间】: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


【解决方案1】:

谢谢小伙子们, 得到了解决方案。

[UIFont preferredFontForTextStyle:UIFontTextStyleBody].lineHeight;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-08
    • 1970-01-01
    • 1970-01-01
    • 2014-06-02
    • 1970-01-01
    • 1970-01-01
    • 2018-10-02
    相关资源
    最近更新 更多