Ios 7 bottomLayoutGuide with uitabbarcontroller

I am trying to snap the bottom of the label to the top of the tab using bottomLayoutGuide introduced in ios7. It works first when I launch the application, but when I switch to another tab and vice versa, the label moves behind the transparent tab (snaps to the bottom of the view).

I added a log to viewDidLayoutSubviews inside one of the tab view controls, and bottomLayoutGuide.length is reset to 0 after returning the corresponding tab.

My viewcontroller is a child of the UITabBarController .

Am I doing something wrong or is it a bug in ios7? This happens both in the simulator and in the device.

+6
source share
1 answer

If you use Interface Builder and storyboards: in the attribute inspector for the view controller, clear the "Extend edges - under lower bars" checkbox. I had a similar problem and it worked for me.

+4
source

Source: https://habr.com/ru/post/955024/


All Articles