请在 iOS7 以后使用。
UIViewController * first = [UIViewController new];
UIViewController * second = [UIViewController new];
second.alpha = 0.7;
// 注意,该代码需要在 viewdidload 之前执行。
second.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[first presentViewController:second animated:YES completion:nil];效果图:
本文展示了一个简单的iOS应用过渡动画实现方法。通过调整UIViewController的alpha属性并设置modalPresentationStyle为UIModalPresentationOverCurrentContext,可以在两个视图控制器之间创建透明覆盖效果。此示例适用于iOS7及更高版本。
540

被折叠的 条评论
为什么被折叠?



