Search code examples
iosuinavigationitem

IOS: How to hide prompt area in NavigationItem


I set prompt text for NavigationItem, and set a timer to remove it like below:

- (void)timerFire_HidePromote:(NSTimer*) theTimer
{
    [self.navigationItem setPrompt:@""];
}

The text can be removed, but the space of the prompt still here, how can I hide all prompt area?


Solution

  • Replace this piece of code:

    [self.navigationItem setPrompt:@""];
    

    With this:

    [self.navigationItem setPrompt:nil];