UIView的。我可以使用的最大边界尺寸是多少? [英] UIView. What are the maximum bounds dimensions I can use?

查看:76
本文介绍了UIView的。我可以使用的最大边界尺寸是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人碰巧知道someView.bounds.size的最大值?我正在创建一个视图层次结构,其中所有子视图的累积边界框等于根父视图。

Does anyone happen to know the maximum value for someView.bounds.size ? I'm creating a view hierarchy with where the accumulated bounding-box of all child views is equal to the root parent view.

干杯,
Doug

Cheers, Doug

推荐答案

根据 UIView文档


在iPhone OS 3.0之前, UIView
实例的最大高度为
,宽度为1024 x 1024.在iPhone OS
3.0及更高版本中,视图不再受限于此最大尺寸,但
仍然有限他们消耗的
内存量。因此,为了您的最佳利益,保持查看
尺寸尽可能小是
。无论
哪个版本的iPhone OS运行
,如果你需要
创建大于1024 x 1024
的视图,你应该考虑使用
CATiledLayer对象。

Prior to iPhone OS 3.0, UIView instances may have a maximum height and width of 1024 x 1024. In iPhone OS 3.0 and later, views are no longer restricted to this maximum size but are still limited by the amount of memory they consume. Therefore, it is in your best interests to keep view sizes as small as possible. Regardless of which version of iPhone OS is running, you should consider using a CATiledLayer object if you need to create views larger than 1024 x 1024 in size.

实际上,我能够在标准的iPhone / iPhone 3G上创建尺寸为2048 x 2048的UIViews和CALayers 2.x版本上面的任何东西都停止渲染。

In actuality, I was able to create UIViews and CALayers that were 2048 x 2048 in size on a standard iPhone / iPhone 3G in 2.x. Anything above that just stopped rendering.

这篇关于UIView的。我可以使用的最大边界尺寸是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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