Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

iphone

uiview

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.

Cheers, Doug

like image 888
dugla Avatar asked Sep 29 '09 17:09

dugla


1 Answers

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.

like image 59
Brad Larson Avatar answered Oct 20 '22 04:10

Brad Larson