UIImageView rotates image with retina 4 iPhone sim

2019-05-24 09:07发布

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:

enter image description here enter image description here

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

enter image description here

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

enter image description here

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?

0条回答
登录 后发表回答