IPHONE: ABPeoplePickerNavigationController Hidden Navigation Bar

Hello, I have an ABPeoplePickerNavigationController, when created, its navigationBar is hidden.

peoplePickerController.navigationBar.hidden = YES; 

This works fine, the only problem is that when the user removes the search box to search for the person, when he returns from the search, the navigation bar is re-displayed. How can I get a notification about this and hide the navigation again?

I also think this is Apple's error, because in normal cases when the search is used, the navigation bar is hidden to make more space and then displayed, but it does not take into account the fact that the bar could be hidden in the first place.

Any trick is welcome.

+6
iphone
source share
2 answers

The safest and easiest way is to keep track of when the keyboard is hiding / showing.

 - (void)keyboardWillHide:(NSNotification *)notification { peoplePickerController.navigationBar.hidden = YES; } - (void)hideNavbarAndKeepHidden { peoplePickerController.navigationBar.hidden = YES; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; } - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; [super dealloc]; } 
+22
source share

If you think this is a mistake, you should send it to http://bugreporter.apple.com .

It also sounds like an error to me, but I would double check the documentation to make sure. If it does not say anything, I suggest reporting an error.

Edit: On the other hand, I think setting the navigation bar here to hide is a bad idea. Is there any special reason to hide this?

+3
source share

All Articles