Reputation: 67
Here is myView
When
self.myView.transform = CGAffineTransformMakeRotation(M_PI*0/180);
[self.myView setFrame:CGRectMake:(self.myView.frame.orgin.x,self.myView.frame.orgin.y,300,self.myView.frame.size.height)];
it will be
now when i rotate the view
And do this again
self.myView.transform = CGAffineTransformMakeRotation(M_PI*0/180);
[self.myView setFrame:CGRectMake:(self.myView.frame.orgin.x,self.myView.frame.orgin.y,300,self.myView.frame.size.height)];
What happened here?
seen like the width is stretched.
Its anyway to fix it or have other way to rotate and resize?
Upvotes: 1
Views: 200
Reputation: 17715
You should use the bounds
and center
properties to resize and place your view, frame should not be used if the transform property is not the identity transform
(see warning at the UIView documentation for frame)
frame.size
is not equal to bounds.size
when your view is rotated, if you want your view to have a width of 300, you should set the bounds
Upvotes: 1