Re: How to properly flip a UIView's coordinate system
Re: How to properly flip a UIView's coordinate system
- Subject: Re: How to properly flip a UIView's coordinate system
- From: Quincey Morris <email@hidden>
- Date: Sat, 21 Sep 2013 14:50:45 -0700
On Sep 21, 2013, at 13:38 , Markus Spoettl <email@hidden> wrote:
> When I remove the transformation, the animation takes place correctly, growing its frame, not just changing the position. Also, when I animate the frame, leaving the size as is, the animation does what is expected, too.
>
> So, it's the transform. Can I do something about that?
Yeah, there is. Don't animate the frame. To quote from the -[UIVIew frame] docs (https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html):
> Changes to this property can be animated. However, if the transform property contains a non-identity transform, the value of the frame property is undefined and should not be modified. In that case, you can reposition the view using the center property and adjust the size using the bounds property instead.
With the transform you're using, the center stays the same (well, to within half a pixel), so you only have to animate the bounds instead of the frame.
_______________________________________________
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