UIView. What are the maximum bounds dimensions I can use?

前端 未结 3 1783
刺人心
刺人心 2020-12-19 08:45

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

3条回答
  •  清歌不尽
    2020-12-19 09:37

    According to the UIView documentation:

    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.

    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.

提交回复
热议问题