简体   繁体   中英

UIImageView not rotating when device orientation changes

I have a VC with two imageViews . One takes up the whole screen, the other is actually slightly larger and can be moved around on the screen (Pan Gesture).

When the device changes orientation only the static view changes orientation, or just updates its frame maybe (automatically).

The second Pan UIImageView does not move. Is there a reason for this, or a switch to make this happen somewhere possibly in the storyboard properties of the UIImageView itself? I would like the view to move too.

I understand that an option would be to use the methods that confirm the orientation has completed a change and transform the imageView myself, which is not a problem... but checking I am not missing something that could do this for me automatically first.

Ensure you are using correct AutoResizeMasks on the imageview. Provide your code or storyboard description for a more complete answer. -Additionally if you are using AutoLayout, you may need to add the appropriate constraints (making it slightly larger than the view may confuse it as to your intention without proper suggestions via constraints).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM