简体   繁体   中英

Common blur effect for top tool bar and navigation bar

I have many ViewControllers inside one NavigationController. In one of ViewControllers I should show toolBar below navigationBar. If simply add it to ViewController with necessary coordinates I have this:

在此处输入图片说明

But here is separator between NavigationBar and ToolBar.

If I set clear background and shadow images and set blur effect for navigationBar it is a problem with different blur effects in navigationBar and toolBar: 在此处输入图片说明 So is it resolution when there is no imagesShadow in navigationBar and there is common blur effect?

I resolve my problem. Idea of resolution make NavigationBar and ToolBar fully transparent. Next On every ViewController in place of bars and below them I put UIVisualEffectView with common height of bar or bars. So UIVisualEffectView simply should be the highest subview of rootView of ViewController. And here is a problem in case of using UITalbeViewController UITabBarController and so on. In my situation there was only UITalbeViewControllers. Firstly I try to use this resolution . But I had problems with creating of multiple subviews wile navigation via different ViewControllers. Finaly I restructure storyboard. Every TableViewController I have replaced by ViewController with rootView simple view. TableView was subview of rootView. Also I put there VisualEffectView. I have done it for every TableViewControllers. Here is a sample of structure:

控制器结构样本

I think there is there better resolution but currently this is optimal.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM