缩小 UIViews(转换问题)

发布于 2024-09-24 13:45:12 字数 313 浏览 0 评论 0原文

所以我使用了CGAffineTransform来放大,

CGAffineTransform newTrans2 = CGAffineTransformScale(mainView.transform,1.05,1.05);
mainView.transform = newTrans2;

我做了15次以获得动画效果。

现在我想缩小,使 mainView 适合 iPhone 框架 (0,0,320,480)。

此外,用户可以捏合和捏合,所以我真的想知道如何缩小并将其重置到原始空间。

我该怎么做?

So I've used CGAffineTransform to zoom in,

CGAffineTransform newTrans2 = CGAffineTransformScale(mainView.transform,1.05,1.05);
mainView.transform = newTrans2;

I do this 15 times to have an animation effect.

Now I would like to zoom out such that mainView fits the iPhone frame (0,0,320,480).

Besides, the user is able to pinch in and pinch out, so I really wonder how I can zoom out and reset it in the original space.

How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

誰認得朕 2024-10-01 13:45:12

只需使用 UIView 动画即可,简单而有效。按照您喜欢的方式配置它:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[mainView setFrame:CGMakeRect(0,0,320,480)];
[UIView commitAnimations];

Just use UIView animation, which is simple yet effective. Configure it however you like:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.75];
[mainView setFrame:CGMakeRect(0,0,320,480)];
[UIView commitAnimations];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文