iOS 11 Swift 4上的UISearchController隐藏状态栏

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;