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