镜像 UIView
我正在开发一个支持多种语言的应用程序。为了支持从右到左开始的语言,我正在转换视图,以便右侧的视图转移到左侧,如下图所示:
我正在使用以下代码来转换view
self.view.transform = CGAffineTransformMakeScale(-1, 1);
我现在想做的是改造将视图置于左侧的新位置以删除镜像文本。例如,我想围绕其中心翻转“FLIP LABEL”,以便正确显示文本。我该怎么做?
I am working on an application that supports multiple languages. In order to support languages that start from right to left, I am transforming the view so that views on the right side get shifted to left side as shown in the images below:
I am using the following code to transform the view
self.view.transform = CGAffineTransformMakeScale(-1, 1);
What I now want to do is transform the views in its new position in the left to remove the mirrored text. For example, I want to flip the "FLIP LABEL" about its center so that the text is displayed properly. How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试在各个子视图上再次运行相同的转换 - 例如:
(或者可能是CGAffineTransformMakeScale(1, 1)
?我不太确定。)You could try running the same transform again on the individual subviews - for example:
(Or maybe it would beCGAffineTransformMakeScale(1, 1)
? I'm not totally sure.)