Pet*_*rbo 7 animation transparency cocoa-touch uiviewcontroller ios
我正在设置self.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;我的应用程序代理,以便我可以呈现视图控制器并使视图透明(请参阅此SO 问题).
这很好用,唯一的一点是我在呈现视图控制器时无法动画.有没有人得到这个工作?如果没有,我还有其他选择吗?
我提出的视图控制器是一个"演练"是由一个UIScrollView和UIPageControl是应该"悬停"在界面上,所以你可以在边缘略微看到它的背景.
我最终这样做了:
AppDelegate *appDelegate = [AppDelegate sharedAppDelegate];
// Set the root VC modal presentation style
appDelegate.window.rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
WalkthroughViewController *walkthroughVC = [[WalkthroughViewController alloc] initWithNibName:nil bundle:nil];
[self presentViewController:walkthroughVC animated:NO completion:nil];
// Manually animate the view
walkthroughVC.view.alpha = 0;
[UIView animateWithDuration:0.5 animations:^{
walkthroughVC.view.alpha = 1;
}];
// Reset root VC modal presentation style
appDelegate.window.rootViewController.modalPresentationStyle = UIModalPresentationFullScreen;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3646 次 |
| 最近记录: |