Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios 7 bottomLayoutGuide with uitabbarcontroller

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.

like image 634
sobral Avatar asked Oct 01 '13 13:10

sobral


1 Answers

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.

like image 55
brainjam Avatar answered Nov 09 '22 16:11

brainjam