Max Image Width and Height in Xcode?

2019-08-18 01:25发布

问题:

I could have sworn that I seen a while back that the max image size you can load into Xcode was 1024 x 1024, meaning you can't use images that are larger than this, but I can't remember where I seen it and I was hoping someone could verify or refute this statement for me? Anyone have any idea? I was hoping to be able to use images that are larger than this incase I need to create an animation file that is very large, but I want to know if this will work first before I start making them. Thanks for any help you can provide.

回答1:

The UIView docs say:

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 of the screen.



回答2:

It don't think XCode has any restrictions on the size of an image.

I've used, large images that 1024x1024 in both iOS and Mac apps. In iOS i've used the large images for maps. On the Mac App I had them a background for the window.



回答3:

It's not XCode that have a size limit but the iPhone. The documentation says 1024x1024 like Jason and rckoenes said but as far as I had tested the largest size of a UIView on the iPhone is 16.000 Pixel (not Points! means on retina 8.000.).
Every view you want to make larger must use a UIScrollView or CATiledLayer