UITextView 最大高度 [英] UITextView Maximum Height

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

问题描述

我在我的应用程序中使用 UITextView 并根据文本的大小设置它的框架.但是,如果 UITextView.size.height 大于 8192.0,文本就会消失.

I use a UITextView in my app and I set it's frame based on the size of the text. However, if the UITextView.size.height is greater than 8192.0, the text just disappears.

UITextView 是否有最大高度?

编辑

我很感激到目前为止的所有答案,但我已经能够毫无问题地设置框架.问题是,如果 frame.size.height 设置为大于 8192.0,文本就会完全消失.

I appreciate all the answers so far, but I'm already able to set the frame with no problem. The problem is that, if the frame.size.height is set greater than 8192.0, the text just completely disappears.

我不确定这个数字有什么特别之处,但是当我将框架设置为大于该数字的高度时,它就会停止工作.

I'm not sure what's special about that number, but when I set the frame with a height greater than that number, it stops working.

推荐答案

查看文档https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html

注意:在 iOS 2.x 中,UIView 对象的最大尺寸为 1024 x 1024 点.在 iOS 3.0 及更高版本中,视图不再受此最大大小限制,但仍受它们消耗的内存量限制.保持视图大小尽可能小符合您的最佳利益.无论运行的是哪个版本的 iOS,您都应该考虑平铺任何明显大于屏幕尺寸的内容.

Note: In iOS 2.x, the maximum size of a UIView object is 1024 x 1024 points. In iOS 3.0 and later, views are no longer restricted to this maximum size but are still limited by the amount of memory they consume. It is in your best interests to keep view sizes as small as possible. Regardless of which version of iOS is running, you should consider tiling any content that is significantly larger than the dimensions the screen.

看来是内存问题而不是具体的高度

It seams that it is a memory problem and not a specific height

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

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