UISearchBar increases navigation bar height in iOS 11 : <p>I have my <code>UISearchBar</code> being part of the navigation bar like:</p>

<pre><code> let searchBar = UISearchBar()
 //some more configuration to the search bar
 .....
 navigationItem.titleView = searchBar
</code></pre>

<p>After updating to <code>iOS 11</code> something weird happened to the search bar in my app. On <code>iOS 10</code> and prior I had my navigation bar looking like:</p>

<p><a href="https://i.stack.imgur.com/1VpIT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1VpIT.png" alt="enter image description here"></a></p>

<p>Now with <code>iOS 11</code> I have: </p>

<p><a href="https://i.stack.imgur.com/GpeXA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GpeXA.png" alt="enter image description here"></a></p>

<p>As you can see there is difference in the rounding of the two search bars which does not bothers me. The problem is that the search bar increases the height of the navigation bar. So when I go to another controller it looks weird too:</p>

<p><a href="https://i.stack.imgur.com/ec5fQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ec5fQ.png" alt="enter image description here"></a></p>

<p>In fact that weird black line's height plus the current navigation bar's height is equal to the height of navigation bar shown in the second picture ... </p>

<p>Any ideas how to get rid of the black line and having consistent navigation bar height across all view controllers ? </p>
