我通过调用旋转了 UIImageView
myView.transform = CGAffineTransformMakeRotation(someRadians)
myView.layer.allowsEdgeAntialiasing = YES;
如果我打电话...
[myView setFrame:CGRectMake(myView.frame.origin.x, myView.frame.origin.y-100, myView.frame.size.width, myView.frame.size.height)];
...我的视野被拉伸(stretch),而不是简单地向上移动一点。
这是正常行为吗?我不应该在旋转 View 后设置框架吗?有解决办法吗?谢谢。
最佳答案
Warning: If the
transform
property is not the identity transform, the value of this property is undefined and therefore should be ignored.
换句话说,如果 View 的frame
没有身份转换,则不要使用它。
关于iOS:-setFrame 在 CGAffineTransformMakeRotation 之后拉伸(stretch) View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24848559/