简体   繁体   English

iOS如何翻转视图/图像并保持比例

[英]iOS How to flip view/image and preserve scale

I can flip my view by doing something like this: 我可以通过执行以下操作来翻转视图:

image.transform = CGAffineTransformMakeScale(-1, 1);

My problem is if I have scaled the item in the app this code obviously sends it back to its original size and flips it. 我的问题是,如果我在应用程序中缩放了该项目,则此代码显然会将其发送回其原始大小并翻转。 How can I maintain the current scale and flip the object? 如何保持当前比例并翻转对象?

获取上下文的当前转换矩阵(CTM),并将翻转转换应用于该矩阵。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM