Reputation: 91
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:
This is the code that i use to customise the navigation bar
[[UINavigationBar appearance] setBarTintColor:barColor];
[[UINavigationBar appearance] setTintColor:buttonColor];
Upvotes: 5
Views: 835
Reputation: 178
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!
Upvotes: 1
Reputation: 21
Try to customise the colour through the Storyboard and not from the code. You see that the white row disappear (I don't know how but it does).
See the image https://i.sstatic.net/lGlJu.png
Upvotes: 0
Reputation: 793
You can add border as your background color
UIColor bgColor = [UIColor blueColor]; // This is your background color.
_searchBar.layer.borderWidth = 1.0;
_searchBar.layer.borderColor = bgColor.CGColor;
Upvotes: 1