Changing interfaceOrientation based on image dimensions
I'm looking to change the phone's rotation based on the size 开发者_如何转开发of an image. is there a way to detect if the image has 480px x 300px dimensions then use landscape rotation and vice versa?
I have many photos some of which are best view landscape and other best viewed in portrait mode.
thanks for any help.
Think hard about whether you want to rotate the whole UIView that the image is on, versus just doing a rotation transform on the image, so it's turned 90 degrees inside a view that's still portrait mode. When I came up against this issue myself recently, I chose the latter. The whole rest of my app is locked in portrait mode, and to have this one view re-orient its whole thing to be landscape was just weird. Instead I float the image out in a UIView up on top of everything else, and rotate it if that's the best-fit orientation of the image.
精彩评论