mangerlahn
mangerlahn

Reputation: 4966

UINavigationBar has wrong height on rotation in Action Extension

I wrote a little app that includes an action extension. Now I am struggling with a rotation issue.

In the beginning, the navigationBar looks like it should. enter image description here

After I rotate the device, the navigation bar keeps its height, while the status bar disappears. enter image description here

When I rotate back, the navigation bar is now 44 points hight, like it should be in landscape. enter image description here

I uploaded a small project to demonstrate the problem to you. I recognized that the Dropbox action extension has the same bug.

The view controller is embedded in a UINavigationController

I assume somewhere down the path forgot to call super. Is there any workaround to fix this?

Upvotes: 2

Views: 767

Answers (1)

Abhinav Chauhan
Abhinav Chauhan

Reputation: 1950

I was experiencing a similar issue. In my case I had a UINavigationController. I was presenting a view controller from a child view controller of UINavigationController. After presentation, when I rotated the device, the height of navigation bar was screwed up.

What I did

Instead of presenting a view controller from a child view controller of UINavigationController, I presented it from the UINavigationController itself. It fixed the problem.

Upvotes: 1

Related Questions