Tejinder
Tejinder

Reputation: 1557

How to change position of UIView with changed transform position?

I have a label which I rotated clock wise. And now I want to change its y position after rotation complete. Can anyone help me to get this done? When I change y position it doesn't change from current position of label, its change from the previous position from where rotation started.

Upvotes: 0

Views: 1032

Answers (2)

Yagnesh Dobariya
Yagnesh Dobariya

Reputation: 2251

Write this line after set y position.

[self.view layoutIfNeeded];      //May this help u

Upvotes: 0

Awesome.Apple
Awesome.Apple

Reputation: 1324

In UIView Class Reference you can see here that you should not set the frame of a view with transform property different than CGAffineTransformIdentity.

If you want to change the position of the transformed view, you should use center property. If you want to adjust the size you should use bounds property.

Upvotes: 1

Related Questions