Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的应用程序中,我想在切换视图时添加自定义过渡。由于它是一个游戏,我想通过淡入黑色然后最终淡入 Play.xib 来进入 Play 视图。那我该怎么做呢?还有任何很酷的过渡可以(对于游戏)转到其他视图,因此我的应用程序看起来更好一些?我只是需要一些帮助。
谢谢!
要淡入或淡出,请在视图后面放置一个黑色背景的视图。然后使用 Core Animation 将alpha视图的属性从 1.0(完全不透明)设置为 0.0(完全透明)。删除旧视图并将其替换为新视图(alpha 设置为 0.0)。然后再次使用 Core Animation 动画化新视图的 alpha 从 0.0 到 1.0 的变化。
alpha