views:

54

answers:

1

I have a base UIView which takes up the entire iPhone screen when the it is horizontal. When the device is rotated to portrait, I want the view to basically just scale down itself and everything in it to 2/3 the size and center it on the screen so everything is shown:

Image: http://img25.imageshack.us/img25/3281/rotateqx.jpg

I can't for the life of me figure it out though. I've messed with autoresizing, but that only seems to work if I do it for each subview, and even though it will scale okay, but because not all the elements are centered they don't end up in the right location in portrait mode.

And as far as for setting the UIViewContentMode, I can get it to work great for individual elements, but not for the view as a whole, and because I'm implementing customized drawing methods, I can't just set it for all the elements individually. Also the who placement issue comes into effect again.

Thanks.

+1  A: 

Have you tried adjusting the view's transform property? If you use CGAffineTransformScale(), you should get the effect you want.

Ben Gottlieb
Perfect. thanks so much.
David