NavigationBar coincides with status bar when searchDisplayController is activated iOS 7 - uitableview

I have a tableView controller which has a searchbar added to tableHeaderView. When I click on searchBar it animates to cover the screen. However, the view behind gets adjusted and navigationBar overlaps with status bar as shown below:
It adjusts back fine, when the search is cancelled. How to hold the view at the back of searchDisplayController not to overlap the status bar?

fixed by doing: [[[parentFileViewController navigationController] navigationBar] setHidden: YES]; in searchDisplayControllerWillBeginSearch method where parentFileViewController contains the searchBar

Related

Animation Delayed for navigationBar "hidesBarOnSwipe"

Hi everyone I have a UITableViewController that hides the navigation bar when the user writes the tableView
navigationController? .hidesBarsOnSwipe = true
When the user shows the navigationBar by scrolling down the tableview, the navigationbar's slide animation appears to be delayed showing a black space between the tableView and the navigation bar
How can you solve this problem?
Here you can see what happens when the navigation bar is shown after the user scrolls down
Maybe you can try in viewDidLoad in your UITableViewController
self.edgesForExtendedLayout = []
Hope it will help you

UISearchController's searchbar is not responding

I am not able to get responding events on tapping UISearchController's search bar in iOS 8.
I am displaying custom view with dim background like alert view appearance, on pressing button in a view, where custom view has UISearchController's search bar as sub view. Programmatically added searchController. When I try to touch search bar, it is not responding in iOS 8 whereas I have added search bar with UISearchDisplayController for iOS 7, it is working fine.
I have viewController A with navigation bar. In viewController A, I have a button. On pressing button, I am trying to show view as custom view with dim background like alert view appearance. So I have added following line in button method.
class_name *view = [[class_name alloc] initWithNibName:#"xib_name" bundle:nil];
[self.navigationController.view addSubview:view];
Xib file of class_name has dim background with subviews like searchController's search bar.
Instead of
[self.navigationController.view addSubview:view];
added
[self presentViewController:view animated:YES completion:nil];
UISearchController's search bar is working now but i am not able to get transparent background view, instead black background appears.
I need to display previous views content and on top that current views content like alert view.
Please guide me in objective-C.

Prevent UISearchDisplayController from hiding under the navigation bar on iPad

I have a tableview with view with search bar on top of the screen below navigation bar. There is also tab bar on this screen. When search controller is activated first, time search bar hides under navigation bar (Translucent set to NO).
In viewDidLoad, searchDisplayControllerDidEndSearch and searchDisplayControllerWillBeginSearch I am setting the search bar frame:
self.searchDisplayController.searchBar.frame=CGRectMake(0, 0, width, 44);
I am not using AutoLayout

alternating between toolbar / tab bar

my app is structured as follow: UITabBarController > UINavigationController > ViewControllerOne > ViewControllerTwo.
the UINavigationBar has at the bottom the tab bar, now when the user navigates into the second view controller, i want to be able to hide the tab bar and replace is with a tool bar. i tried this code:
[self.navigationController.tabBarController.tabBar setHidden:YES];
[self.navigationController.toolbar setHidden:NO];
when i run the app the tab bar is hidden but the toolbar doesn't appear. plus, since the last VC is a table view controller, when i scroll through the cells there is a white gap between the table and the bottom of the view. how can i fix that?
That won't work because when you hide the tab bar like that the subviews won't be adjusted properly (that's why you get the white space). You'll have to use
self.hidesBottomBarWhenPushed = YES;
In your init method or awakeFromNib... and then
[self.navigationController setToolbarHidden:NO animated:YES];
In the viewDidLoad for example.
That way the tab bar controller's view is going to layout correctly it's subviews when you hide the tab bar. Just remember to call self.hidesBottomBarWhenPushed = NO; in your first view controller otherwise the tab bar is still going to be hidden when the second view controller is popped from the navigation stack.
Try to assigning toolbar with appropriate frame and adding it to self.tabBarController.view

How to move table view in navigation controller

I have a navigation controller and when I place an image for navigation bar by hiding it the table view which is below the navigation bar it is moving upside and first row is hide by the image. I want that (row) table to move down.
If I am not hiding the navigation bar its working correctly and the image also added above the navigation bar perfectly but I am not able to see the navigation bar back button on the next screen because whatever image I added was covering this bar.
How can I remove this image if we cannot move the tableview in first view?
if you are trying to put an image into a navbar's title, as it sounds..a much simpler way is:
UIImageView *headerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:#"myimage.png"]];
self.navigationItem.titleView = headerImageView;
[headerImageView release];

Resources