UIImageView rotates image with retina 4 iPhone simulator but not retina 3.5/regular simulator

社会主义新天地 提交于 2020-01-13 19:11:31

问题


The way UIImageView autorotates some images and not others (or autorotates images at all) completely baffles me and I can't find the settings to turn off this autorotate behavior.

As a test I created a project using the iOS6 SDK targeted to iPhone 5 with the following steps:

  • I took a photo using my iPhone 4's front facing camera with portrait orientation
  • transferred it to my desktop using DropBox
  • imported it into my project and specified it in StoryBoard as the source for a UIImageView.

These are the layout settings for the imageView:

Running it in the simulator for the retina3.5 and iPhone 5 the image appears upright:

Running it in the simulator for the retina 4 I get this rotated image:

Obviously something odd is going on.

I am completely baffled and frustrated with this UIImageView auto-rotation. I've run into this before and spent fruitless hours trying to sort it out. I understand that images taken with the iPhone cameras have an orientation property. I don't understand why an image taken in portrait mode is not displaying in portrait mode in the retina 4 simulator.

Is there a way I can turn off this "help" from UIImageView?

来源:https://stackoverflow.com/questions/14074875/uiimageview-rotates-image-with-retina-4-iphone-simulator-but-not-retina-3-5-regu

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