UIScrollView 大小以匹配 UITextView 大小 [英] UIScrollView size to match UITextView size

查看:32
本文介绍了UIScrollView 大小以匹配 UITextView 大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 UIScrollView,在 UITextView 中有一个文本块.文本可以是来自服务器的任意数量的单词.

I have a UIScrollView with a block of text in a UITextView. The text could be any amount of words coming from a server.

我希望滚动视图的滚动大小与 UITextView 的大小相匹配.

I want the scroll view to be the correct scroll size to match the size of the UITextView.

目前的做法是什么?

截图:

推荐答案

UITextViewUIScrollView 的扩展.因此,您可以使用 contentSize 属性获取其内容大小.

UITextView is an extension of UIScrollView. So you can get its content size using contentSize propery.

这篇关于UIScrollView 大小以匹配 UITextView 大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆