Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITabbarController layout issues in iOS 7 - view going behind the navigation bar

I'm working on mobile solution which needs to be upgraded to iOS 7. I've a tabbar controller with 4 tabs which is embedded in a Navigation Controller. All 4 view controllers of tab bar are having a tableview laid at (0,0) origin and set to size of view with resizing handles set properly. When I launch the application, the table view in the first tab bar item is displaying properly below the navigation item where as the table views in the remaining 3 tabbar items are going below the navigation item. The base controller is same for all view controllers in which I've set the following code.

if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
    [self performSelector:@selector(setEdgesForExtendedLayout:) withObject:[NSNumber numberWithInt:UIRectEdgeNone]];
}

I've also deselected "Under Top Bars" & "Under Bottom Bars" under "Extend Edges" section in storyboard for the concerned view controllers. But still the issue remains same.

Any inputs on this would help me a lot.

Thanks

Sudheer

like image 355
Dantuluri Avatar asked Oct 07 '13 11:10

Dantuluri


2 Answers

The issue has been fixed by setting setEdgesForExtentedLayout to UIRectEdgeNone to UITabbarController rather than setting it to each and individual view controllers in the tab bar.

like image 116
Dantuluri Avatar answered Oct 18 '22 07:10

Dantuluri


Try this:

self.tabBarController.tabBar.translucent = NO;
like image 6
Mutawe Avatar answered Oct 18 '22 06:10

Mutawe