石英 2D 动画
我想创建一个应用程序,每 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解了您的查询,那么您应该创建自己的类,该类将成为 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....