导航栏下方的空白区域,显示为SearchSearchBarInNavigationBar = YES [英] Empty space below navigation bar with displaysSearchBarInNavigationBar = YES

查看:366
本文介绍了导航栏下方的空白区域,显示为SearchSearchBarInNavigationBar = YES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的导航栏中的搜索栏出现问题,使用属性 displaysSearchBarInNavigationBar = YES
导航栏和搜索内容之间有一个空格,等于导航项+状态栏的高度。
就好像在构建视图时,框架不知道我的搜索栏是导航栏...这个空白空间出现在小费之前,以及显示结果表时。

I've an issue with a search bar in a navigation bar using the property displaysSearchBarInNavigationBar = YES. I have an empty space between the navigation bar and the search content which is equals to the height of the navigation item + status bar. It's just as if during building the view, the framework doesn't know that my search bar is the navigation bar... This empty space appears before tipping anything, and when displaying the result tables.

除了这个主题,我没有找到与此问题相关的任何内容:
在iOS7中将搜索栏与导航栏组合时清空UISearchbar空间?

I haven't found anything related to this issue except this topic: Empty UISearchbar space when combining search bar with Nav bar in iOS7?

我尝试使用搜索栏高度等于0表示,但它对我不起作用。

I tried with search bar height equals to 0 as said, but it didn't work for me.

请问这个空白空间吗?

Any idea please about this empty space ?

推荐答案

对我来说,关键是设置选项以在StoryBoard编辑器中启用Under Opaque Bars。

For me the key was to set the option to enable "Under Opaque Bars" in the StoryBoard editor.

这篇关于导航栏下方的空白区域,显示为SearchSearchBarInNavigationBar = YES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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