IPHONE: ABPeoplePickerNavigationController hidden navigation bar

后端 未结 2 1718
谎友^
谎友^ 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: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];
    }
    

提交回复
热议问题