iOS 11 Swift 4上的UISearchController隐藏状态栏 [英] UISearchController hiding status bar on iOS 11 Swift 4

查看:98
本文介绍了iOS 11 Swift 4上的UISearchController隐藏状态栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 searchViewController ,其颜色为DarkBlue,当我搜索并单击结果时,我的viewController的NavigationBar颜色为白色...因此,当我回到 searchViewController 时,我的 statusBar 会被隐藏成白色.

I have one searchViewController which have navigationBar color as DarkBlue and when i search and get result on click of that i have viewController with navigationBar color as white... So when i came back to searchViewController my statusBar will get hide with white color.

推荐答案

我想这会解决您的问题.

I guess this will solve your problem.

self.searchController.hidesNavigationBarDuringPresentation = NO;
self.definesPresentationContext = YES;

这篇关于iOS 11 Swift 4上的UISearchController隐藏状态栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆