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

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

问题描述

有人知道 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.

干杯,道格

推荐答案

根据UIView 文档:

在 iPhone OS 3.0 之前,UIView实例可能有最大高度和 1024 x 1024 的宽度.在 iPhone 操作系统中3.0 及更高版本,视图不再限于此最大大小,而是仍然受到数量的限制他们消耗的内存.因此它是以您的最佳利益保持视野尺寸尽可能小.不管哪个版本的 iPhone 操作系统是运行,你应该考虑使用CATiledLayer 对象(如果需要)创建大于 1024 x 1024 的视图大小.

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.

实际上,我能够在 2.x 的标准 iPhone/iPhone 3G 上创建大小为 2048 x 2048 的 UIViews 和 CALayer.上面的任何东西都会停止渲染.

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.

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

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