Re: autoresizingMask and transformation
Re: autoresizingMask and transformation
- Subject: Re: autoresizingMask and transformation
- From: David Duncan <email@hidden>
- Date: Mon, 1 Aug 2011 09:47:55 -0700
On Jul 31, 2011, at 7:18 PM, Tales Pinheiro De Andrade wrote:
> I have a custom view that have a square subview. The superview is stretched in both directions when the device is rotated.
>
> The subview has autoresizingMask=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
If you want the view to remain square, then you don't want flexible height & width, because the default is to resize with respect for aspect ratio. If you want the view to resize but stay square, then you will have to resize it yourself. You can use the willAnimateAutorotation… method on UIViewController to do this with animation – see the docs for specifics.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden