Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is there a white line on UISearchController when click on the search bar?

enter image description here

enter image description here enter image description here

As you can see from the picture, there is a white line when you search bar is click. I had try to set the background image to UIImage and clear all the shadow image but still this white line keep coming out when the search bar click and animate.

Pooja Gupta solution result:

enter image description here

This is the code that i use to customise the navigation bar

 [[UINavigationBar appearance] setBarTintColor:barColor];
[[UINavigationBar appearance] setTintColor:buttonColor];
like image 553
KZY Avatar asked Oct 28 '22 21:10

KZY


1 Answers

I had a same issue. When scrolling down scrollview there was a white line between navi-bar and search bar. By inspecting UI hierarchy I found out that there is a gap between them.

The color of the gap would be other view's background color, like tableview, collection, or webview. In my project case there is a webview. So I put a backgoround color same as navigation bar's tint color on webview's scrollview. Then problem solved!

enter image description here

like image 101
NakCheon Owen Jung Avatar answered Nov 15 '22 06:11

NakCheon Owen Jung