presented 新控制器时如果控制器的view背景颜色alpha不为1时,为什么会变成黑色背景。
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了presented 新控制器时如果控制器的view背景颜色alpha不为1时,为什么会变成黑色背景。相关的知识,希望对你有一定的参考价值。
NavigationController and the View Controllers are designed in such a way that only one view controller may show at a time. When a new view controller is pushed/presented the previous view controller will be hidden by the system. So when you reduce the modal view‘s alpha you will possibly see the window‘s backgroundColor (the black color you see now).
If you want a translucent view to slide-in over the main view, you can add the view as the subView of main view and animate it using UIView Animations.
以上是关于presented 新控制器时如果控制器的view背景颜色alpha不为1时,为什么会变成黑色背景。的主要内容,如果未能解决你的问题,请参考以下文章
Presenting view controllers on detached view controllers is discouraged <CallViewController: 0x14
ios Presenting view controllers on detached view controllers is discouraged <BasicInfoVC: 0x7fb2d
在swift中使用present时如何阻止ViewController闪烁
从View Controller调用dismissViewControllerAnimated后刷新View Controller