我的装置有一个奇怪的问题UISearchDisplayController
。当搜索显示激活背景衰落视图的框架时,和tableview
会错误地重叠UISearchBar
。看来结果tableview
未考虑的偏移量UIStatusBar
。
的ViewController
是使用auto layout
。由于应用程序不使用任何不透明的条,因此视图控制器不会扩展其任何边缘。
Extend edges under top bars = NO,
under bottom bars = NO, and
under opaque bars = NO.
这是初始布局:
搜索显示激活时将发生以下情况:
最后,这是搜索的结果输出:
I solved my own problem. A hard lesson learned. After a few hours of thinking "It really shouldn't be this hard." I realized that my instance of UISearchDisplayController was not properly linked to the API provided property of its parent view controller. If you're using UIStoryBoards / Interface Builder be sure to click on your ViewController and view its provided outlets in the inspector. If you see this:
Then something is wrong and you're going to run into issues just as I had. What you'll want to do is to click in that empty circle and drag to your instance of the Search Display Controller. If things are linked up right you should see this:
我愚蠢地没有注意这一点,而是创建了自己的IBOutlet来引用搜索显示控制器。这导致IB取消了提供的API,因为UIViewController只能支持一个Search Display Controller。如果您需要我澄清任何事情,请告诉我。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句