本文介绍了带有displaysSearchBarInNavigationBar的UISearchDisplayController使用navigationBar.translucent = false推送结果视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用UISearchDisplayController和新的ios 7功能displaysSearchBarInNavigationBar和不透明的导航栏。搜索显示控制器似乎错误地定位了它的视图。

I am using a UISearchDisplayController with the new ios 7 feature displaysSearchBarInNavigationBar and opaque navigation bars. The search display controller seems to position it's view incorrectly.

我尝试插入委托方法并重新定位但是我无法获得初始位置,也不能在旋转时。此外,这似乎是一个草率的解决方案。

I tried plugging in to delegate methods and repositioning but I can not get the initial position correct, nor when rotating. In addition, this seems like a sloppy solution.

推荐答案

在视图控制器的故事板中启用Under Opaque Bars或者如果你想编码。然后添加以下行。你好:)

Just enabled "Under Opaque Bars " in the storyboard for your view controller or if you like to code.Then add the below lines.Your good :)

self.edgesForExtendedLayout = UIRectEdgeAll;
self.extendedLayoutIncludesOpaqueBars = YES;

这篇关于带有displaysSearchBarInNavigationBar的UISearchDisplayController使用navigationBar.translucent = false推送结果视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 12:20