ios - Small gap between UINavigationBar and UISearchBar -


i added uisearch programmatically app , uinavigation bar added in interface builder. when added search bar left tiny gap between search bar , nav bar. there way merge them together? thanks.

screenshot

self.searchbar = [[uisearchbar alloc] initwithframe:cgrectmake(0.0, 0.0,    self.view.bounds.size.width, 44.0)]; self.searchbar.delegate = self; self.searchbar.autoresizingmask = uiviewautoresizingflexiblewidth; self.searchbar.showscancelbutton = no; [self.view addsubview:self.searchbar]; 

if making sure searchbar right under navigation bar, use autolayout so:

self.searchbar = [[uisearchbar alloc] init]; self.searchbar.translatesautoresizingmaskintoconstraints = no; self.searchbar.delegate = self; self.searchbar.showscancelbutton = no; [self.view addsubview:self.searchbar];  id toplayoutguide = self.toplayoutguide; uisearchbar *searchbar = self.searchbar; //updated  [self.view addconstraints:[nslayoutconstraint constraintswithvisualformat:@"h:|[searchbar]|" options:0 metrics:0 views:nsdictionaryofvariablebindings(searchbar)]]; [self.view addconstraints:[nslayoutconstraint constraintswithvisualformat:@"v:[toplayoutguide][searchbar]" options:0 metrics:0 views:nsdictionaryofvariablebindings(searchbar, toplayoutguide)]]; 

edit:

i did searching , found not gap. image apple uses divide things place. there many options can approach

1.) search , destroy - find uiimageview, , remove bar.
remove uitoolbar hairline in ios 7

2.) set custom background bar

[self.navigationcontroller.navigationbar setbackgroundimage:[uiimage new] forbarmetrics:uibarmetricsdefault]; self.navigationcontroller.navigationbar.shadowimage = [uiimage new]; 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -