iOS:-setFrame 在 CGAffineTransformMakeRotation 之后拉伸(stretch) View

标签 ios core-graphics transform frame

我通过调用旋转了 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 后设置框架吗?有解决办法吗?谢谢。

最佳答案

来自UIView documentation :

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/

相关文章:

javascript - Phonegap 应用程序 SQLite 数据库初始设置

ios - 如何在 iOS 上读取-修改-写入 PDF (CGPDFDocument)?

ios - 如何提高CGLayer的绘图质量

iphone - 如何将白色像素更改为黑色像素

box2d、setTransform 和碰撞

css - 在 Chrome 中工作的 SVG 上的 CSS 动画的 transform-origin,而不是 FF

iphone - 使用2G,3G,4G网络的iPhone应用程序

ios - 如果不快速执行任何操作,如何重复本地通知

iphone - 右对齐 EntryElement

r - 捕获列模式频率