Max Image Width and Height in Xcode?

こ雲淡風輕ζ 提交于 2019-12-11 23:41:45

问题


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



来源:https://stackoverflow.com/questions/6032463/max-image-width-and-height-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!