iOS Search bar mess up with Navigation bar

69 views Asked by At

[![enter image description here][1]][1]I am facing issue with UISearchBar & UISearchDisplayController. When I click on searcher then it messes up with the Navigation bar. I have tried to fix with many codes but did not work. I am creating UIsearch bar and UISearchDisplayController via pragmatically. Please help. Any suggestion will be Great.

 // Search Bar
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0,subView.frame.size.width, 52)] ;
searchBar.delegate=self;

//UISearchDisplayController
searchController=[[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self] ;
[searchController setDelegate:self];
[searchController setSearchResultsDataSource:self];
[searchController setSearchResultsDelegate:self];
[searchController.searchResultsTableView setDelegate:self];
0

There are 0 answers