Amogh Talpallikar
Amogh Talpallikar

Reputation: 12184

How to calculate the rotation and scale from a view's transform property ?

I have a UIView which I rotate to certain angle or say scale to a level and then I stretch it from its two ends. to stretch I need to change its frame. Before Changing the frame I need to restore its transform to identity and then only I can change its frame and apply the same rotation and scale again.

Upvotes: 0

Views: 176

Answers (1)

danh
danh

Reputation: 62686

// save it
CGAffineTransform transform = myView.transform;
// reset it
myView.transform = CGAffineTransformIdentity;
// change the frame
myView.frame = CGRectMake(/*do stuff to the frame*/);
// restore it
myView.transform = transform;

Upvotes: 1

Related Questions