I have a Controller that has a navigation controller and search display controller.
I need to place a Image over the navigation controller view and the search display controller ie:
+-------------------------------+
|I| Title |
|I|-----------------------------+
|I| [Search ]|
+-------------------------------+
I need to place the image in the “I” section. What I am doing is in the viewWillAppear add the view to the navigationController:
[self.navigationController.view addSubview:myImage];
That is running fine. But the trouble I is when the user start tipping something in the search bar and cancels the search.
In this method I am trying to put the view again over the navigation controller: – (void)searchDisplayController:(UISearchDisplayController *)controller didHideSearchResultsTableView:(UITableView *)tableView in this way:
[self.navigationController.view addSubview:myImage];
But the navigation bar is hiding my image. Is there any way that I can’t prevent the navigation bar hiding my subview?
Assuming your UINavigationcontrolelr is in your main UIWindow, this would add the image to the main window on top of everything else