CGAffineTransform(旋转)后 view.frame.size 属性会发生什么?
我有一个 UIImageView,可以通过捏合和捏合来调整大小(示例:view.frame.size.width+10)。 Image View的图像也可以旋转(CGAffineTransformMakeRotate)。 好吧,这就是问题:当我在应用旋转变换后调整 UIImageView 的大小时,视图大小会异常调整(相反(应增长时收缩,反之亦然)或以巨大的调整大小单位增量) 。 无论是否应用 CGAffineTransform,如何以一致的方式调整 UIImageView 的大小?
I have a UIImageView that can be resized by pinching in and out (Example: view.frame.size.width+10). The image of the Image View can also be rotated (CGAffineTransformMakeRotate). Okay, here is the problem: When I resize the UIImageView AFTER having had applied a Rotate Transform the view resizes abnormally (inversly (shrink when it should grow, vice-versa) or at enormous resize unit increments). How can I resize my UIImageView in a consistent manner whether or not a CGAffineTransform is applied?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
UIView 也就是说,对于
frame
属性:请改用
bounds
和center
属性; 应用变换后它们仍然可行。There's a warning in the documentation for UIView that says, for the
frame
property:Use the
bounds
andcenter
properties instead; they remain viable after a transform is applied.