I am trying to anchor the bottom of a label to the top of a tabbar using bottomLayoutGuide
introduced in ios7. it works initially when I run the app, but when I switch to the other tab and back again the label moves behind the translucent tabbar (gets anchored to the bottom of the view).
I added a log to viewDidLayoutSubviews
inside one of the tab's viewcontroller and the value of bottomLayoutGuide.length
is reset to 0 after the respective tab is switched back.
My viewcontroller is a child of UITabBarController
.
Am I doing something wrong or is this a bug in ios7? This happen both in the simulator and device.
If you are using Interface Builder and storyboards: in the attributes inspector for the view controller, deselect 'Extend Edges - Under Bottom Bars'. I was having a similar problem and this worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With