【问题标题】:get textView contentsize height is wrong in iOS 8在 iOS 8 中获取 textView contentsize 高度错误
【发布时间】:2017-03-09 18:33:21
【问题描述】:

use masonry 设置了textView的约束,在[textView layoutIfNeed]之后得到textView.contentSize.height,这个值为-8

这个bug只存在于小于9.0的systemVersion中

找到方法并尝试:

[[textView layoutManager] usedRectForTextContainer:textView.textContainer]

gettextView.contentSize.height也不对

【问题讨论】:

    标签: ios textview autolayout ios8 contentsize


    【解决方案1】:

    试试这个,在将文本分配给 textview 之后

    txtview.sizeToFit()

    【讨论】:

      猜你喜欢
      • 2014-11-24
      • 1970-01-01
      • 1970-01-01
      • 2014-05-12
      • 1970-01-01
      • 2015-02-01
      • 2017-07-16
      • 2016-12-14
      • 1970-01-01
      相关资源
      最近更新 更多