首页 > 代码库 > presented 新控制器时如果控制器的view背景颜色alpha不为1时,为什么会变成黑色背景。

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时,为什么会变成黑色背景。