gpt4 book ai didi

ios - 获取 textView contentsize 高度在 iOS 8 中是错误的

转载 作者:行者123 更新时间:2023-11-29 11:53:09 27 4
gpt4 key购买 nike

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

此bug只存在于9.0以下的systemVersion

找个方法试试:

[[textView layoutManager] usedRectForTextContainer:textView.textContainer]

get textView.contentSize.height也不对

最佳答案

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

txtview.sizeToFit()

关于ios - 获取 textView contentsize 高度在 iOS 8 中是错误的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40278430/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com