IOS app layout is wrong in call status bar

Faced issue with status bar during active call and app layout.

I am using autorun. When I run the application and then run the call, everything works fine, the UI scales correctly with the changed status bar.

But if I first started the call and then launched the application, the application screens moved 20 points down, as if they were not responding to the new status bar. And even if I turn off the call, the UI will be moved from the bottom.

Can anyone know how to fix this?

+3


source to share


1 answer


It's easy when you have specified constraints on your views that you gave them in relation to the TLG (Top Layout Guide) of your view controller. Now, when a call occurs, the status bar changes, which causes the TLG to change and, as a result, the views move.

To prevent this, you can specify an upper bound on your view relative to the top of the supervisor. Now, in this case, the constraint constraints are independent of the TLG, which changes when the status bar is resized, so they do not change during a call or any other event that resizes the status bar. An example view, the upper limit of which refers to the top of the supervisor



An approximate view, the upper limit of which relative to the TLG

-1


source







All Articles