石英 2D 动画

发布于 2024-09-05 20:50:20 字数 198 浏览 0 评论 0原文

我想创建一个应用程序,每 1 秒后会在屏幕上显示 4-5 个单词,但最后一个单词会缩小/放大。我可以轻松创建静态单词,对于最后一个动画单词,我需要再次绘制静态单词。 我如何创建两个单独的图层,以便静态文本位于一层上(我将在每一秒后填充它),而最后一个单词(动画文本)将位于另一层上。

如何创建 2 个独立的图层?连接在同一屏幕上但单独处理它们的drawRect方法?

I want to create an app which after each 1 second will show 4-5 words on screen but the last word will zoom out/in. I can easily create static words and for the last animating word i need to draw the static again n again.
How can i create 2 separate layers so the static text is on one layer ( i will fill it after each second) and the last word (animated one) will be on other layer.

How to create 2 separate layers? Attached on same screen but handling their drawRect method separately?

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

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

发布评论

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

评论(1

贪恋 2024-09-12 20:50:20

如果我理解了您的查询,那么您应该创建自己的类,该类将成为 UIView 的子类,并在实现中覆盖 drawRect 方法,然后在创建图层对象的位置创建自定义 UIView 类的 2 个对象。你可以有 x,y 坐标变量,它们将分别为两个层工作......

If I have understood your query then you should make your own class which will be subclass of UIView and override drawRect method in the implementation, then create 2 objects of your custom UIView class at the place where you are making layer's object. you can have x,y co-ordinate variables which will work separately for both layers....

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文