顶部工具栏和导航栏的常见模糊效果

时间:2017-02-07 11:07:55

标签: ios objective-c uinavigationbar uitoolbar uiblureffect

我在一个NavigationController中有很多ViewControllers。在其中一个ViewControllers中,我应该在navigationBar下面显示toolBar。如果只需将其添加到具有必要坐标的ViewController,我就有了这个:

enter image description here

但这里是NavigationBar和ToolBar之间的分隔符。

如果我设置了清晰的背景和阴影图像并为navigationBar设置了模糊效果,那么导航栏和工具栏中的不同模糊效果就会出现问题: enter image description here 那么当navigationBar中没有imagesShadow并且存在常见的模糊效果时它的分辨率是什么?

1 个答案:

答案 0 :(得分:0)

我解决了我的问题。解决方案的想法使NavigationBar和ToolBar完全透明。 Next在每个ViewController上代替条形图并在它们下面我将UIVisualEffectView放在公共高度为bar或bar的位置。所以UIVisualEffectView应该是ViewController的rootView的最高子视图。在使用UITalbeViewController UITabBarController等情况下,这是一个问题。在我的情况下,只有UITalbeViewControllers。首先,我尝试使用this resolution。但是我在通过不同的ViewControllers创建多个子视图时遇到了问题。最后我重组了故事板。每个TableViewController我已经用ViewView简单视图取代了ViewController。 TableView是rootView的子视图。我也把VisualEffectView放在那里。我已经为每个TableViewControllers完成了它。 以下是结构示例:

Sample of structure of controller

我认为有更好的分辨率,但目前这是最佳的。