Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

View is hidden below status bar when a call is active #44

Closed
laubengaier opened this issue Jul 27, 2018 · 4 comments
Closed

View is hidden below status bar when a call is active #44

laubengaier opened this issue Jul 27, 2018 · 4 comments
Assignees

Comments

@laubengaier
Copy link

laubengaier commented Jul 27, 2018

Hi,

When making a transition to a detail viewcontroller with motion while calling and switching back to the main viewcontroller the main viewcontroller will jump up and leaves a 20px gap at the bottom. I put up a example project to reproduce it:

https://github.com/laubengaier/MotionTest

simulator screen shot - iphone se - 2018-07-27 at 15 35 43

@OrkhanAlikhanov
Copy link
Contributor

Thank you! We will investigate this.

@OrkhanAlikhanov
Copy link
Contributor

This seems to be iOS bug but I believe we can workaround this.

Here is what is going on under the hood:

When in-call/hotspot/recording status bar (let's call it thick status bar) is enabled/disabled, frame.origin.y of the topmost view in the window subview hierarchy (rootView) is increased/decreased by 20. So the thick statusBar only changes rootView's y position

When we do a modal transition from any (let's say deepest) view controller ( fromViewController) in the hierarchy to an arbitrary view controller (toViewContoller), new view of type UITransitionView is created. It becomes the rootView, contains views of both from and to viewControllers and lives until the toViewController is dismissed.

When UITransitionView becomes the rootView and we have thick status bar, y value of previous rootView is reduced by 20, so it becomes 0 (but in Motion's case it became -20 in between transitions). And that UITransitionView, now being the rootView, happens to have y value of 20. So the thick status bar only affects rootView no matter what it is.

Now, when the modally presented toViewController is getting dismissed, and the transition is complete, that UITransitionView (as well as toViewController) is removed from the hierarchy and previous rootViewController (not fromViewController) now becomes the rootView.

Since rootViewController now became the rootView and its frame was changed due to the insertion of UITransitionView previously, the code (which is inside UIKit) that had changed our rootViewController's y value is also responsible for setting it back. Here is the point where I tend to believe is UIKit bug. In the case of dismissal of UIKit modal transition, the value (I mean rootViewController's y value) is successfully updated back, but when we dismiss a Motion modal transition that value is updated incorrectly, UIKit sets 20 for y value in the case of UIKit dismissal but 0 for Motion dismissal (considering that we have thick status bar).

@DanielDahan We can workaround this by setting rootViewController.frame.origin.y = 20 upon the completion of modal transition if we have thick status bar. What do you think?

@daniel-jonathan
Copy link
Member

The fix for this is now in the development branch. Thank you @OrkhanAlikhanov. A Release will be ready tomorrow.

@laubengaier
Copy link
Author

@OrkhanAlikhanov thanks for your well explained reply I appreciate it. I'll try the fix today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants