“红色警戒” Quartz 2D 或 CALayer 动画的动画效果?
我是动画新手,我只是找不到有关如何创建警报灯(闪烁的简单红色警报灯)的数据。
我知道如何制作 CALayer 动画和 Quartz 2D 的基础知识,我只是在寻找有关如何实现背光效果的教程或方向?
谢谢 沙尼
I am new to animations and I just can not find data on how to create an alert light (simple red alert light that flickers).
I know how to animate CALayer and the basics of Quartz 2D, I am just looking for a tutorial or direction on how to achieve back light effect?
Thanks
Shani
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非常hacky的代码(可以工作,但尽量不要在生产中使用它):
uiView1 & uiView2 彼此完全重叠。您可以将两个 uiView 替换为两个 UIImageView,其中一个具有打开的灯图像(红色),另一个具有关闭的灯图像(黑色/灰色)。在这种情况下,背景颜色的变化将是多余的。
Very hacky code (works but try not using it in production):
uiView1 & uiView2 completely overlap each other. You can replace the two uiView's with two UIImageView's, with one having an image of light turned on (red) and one with light turned off (black/gray). In which case background color change will be redundant.