1

There was an issue in iOS 11 for UINavigationBar, when set topItem.prompt with code:self.navigationController.navigationBar.topItem.prompt = @"(1/5)" :

it works well on iOS 8~10, when it shows the prompt navigationBar will automatically changed height from default 44 to 74 (iPhone 5S);

while in iOS 11 the navigationBar height was still 44, thought the appearance was fine, the navigation button can't be clicked due to this height issue. Please see the snap image on iOS 8 and iOS 11: iOS 8 iOS 11

Is there any way to fix this issue without using custom navigationBar?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
fizix100
  • 73
  • 1
  • 10
  • 1
    I have cross verified this issue by implementing and it is working fine although the height of navigation bar is increased while using "prompt".Check that navigation bar button item is added properly(check whether any other view is overlapping it or not) – Dhruv Apr 09 '18 at 13:19
  • Thanks, I've fixed this issue by adding code `[self.navigationController.navigationBar sizeToFit];` after setting the topItem.prompt; I think there was an issue in iOS 11 that navigationBar couldn't change its height dynamicly, while there was no problem on iOS 8 ~ 10. – fizix100 Apr 10 '18 at 02:40

1 Answers1

0

I've fixed this issue by adding code [self.navigationController.navigationBar sizeToFit]; after setting the topItem.prompt.

Seems that there was an issue in iOS 11 that navigationBar couldn't change its height dynamicly. If the topItem.prompt was set before navigationBar shown, it didn't have this issue. But after shown, if we want to add an topItem.prompt, have to add the code. letting the navigationBar change to right height.

fizix100
  • 73
  • 1
  • 10