4

I have created a very minimal demo app to show some basic navigation using a UINavigationController:

I have two storyboards. The idea is to let a tap on a UIBarButtonItem in (A) present a view controller (B) from a second storyboard, then be able to dismiss (B) to return to (A).

Not sure how technical I need to be, as I'm just puzzled by the appearance of the UIBarButtonItem when returning to A (seen in the screenshot as C). Basically, the button appears to be disabled.

When I change the bar button to show an image, the image does not change appearance and basically works as expected.

Any ideas?

I tap the UIBarButtonItem A, then tap B, expecting to see the UIBarButtonItem look like A, but it instead looks like C.

Johan
  • 2,472
  • 1
  • 23
  • 25
  • Seem like you got same problem with this question https://stackoverflow.com/questions/47805224/uibarbuttonitem-will-be-always-highlight-when-i-click-it – trungduc Dec 14 '17 at 11:15
  • Does the button still work even though it looks disabled? – davidethell Dec 14 '17 at 11:18
  • Yes, the button works. If it was actually disabled, it would be less puzzling and easy to fix. This is however only the appearance of being disabled, and only when the button is using a caption. – Johan Dec 14 '17 at 13:06

2 Answers2

0
For iPhone X support follow below things:

1. Enable Safearea to your ViewController's XIB or Storyboard's ViewController
2. Top Touchable controls (Button, textfield etc) should be top from SafeArea not from superview
3. Bottom Touchable controls (Button, textfield etc) should be bottom to SafeArea not from Superview.

If you are not following above things not sure touch (Top and Bottom) will work or not. If you follow all will work fine
Jeetendra Kumar
  • 500
  • 3
  • 9
  • 1
    Sorry, this is not an iPhone X specific issue. The same behaviour is seen on any device. – Johan Dec 14 '17 at 14:48
0

Yes, @the4kman is right - this is a duplicate; and I solved it for iOS 11.2 as suggested (except I did it in viewWillAppear): https://stackoverflow.com/a/47754627/84682

Johan
  • 2,472
  • 1
  • 23
  • 25