Search bar getting hidden by navigation bar when becomes active

╄→гoц情女王★ 提交于 2019-12-05 10:23:22

Try this:

Set the navigation bar's translucent property to NO:

self.navigationController.navigationBar.translucent = NO;

This line will fix the view from being framed underneath the navigation bar and status bar.

If you have to show and hide the navigation bar, then use this code in viewDidLoad

 if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    self.edgesForExtendedLayout = UIRectEdgeNone;   // iOS 7 specific
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!