IPHONE: ABPeoplePickerNavigationController hidden navigation bar

后端 未结 2 1715
谎友^
谎友^ 2021-01-31 06:31

Hello I have a ABPeoplePickerNavigationController, on creation is set its navigationBar hidden.

peoplePickerController.navigationBar.hidden = YES;
相关标签:
2条回答
  • 2021-01-31 07:21

    If you believe this is a bug you should submit it to http://bugreporter.apple.com.

    To me it also sounds like a bug, but I'd double-check with the documentation to make sure. If it doesn't mention anything, then I suggest reporting the bug.

    Edit: On the other hand, I would think setting the navigation bar here to be hidden is a bad idea. Is there a particular reason for wanting to hide it?

    0 讨论(0)
  • 2021-01-31 07:27

    The safest and simplest method is to track when the keyboard hides/shows.

    - (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];
    }
    
    0 讨论(0)
提交回复
热议问题