Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS7 table view embedded in tab bar doesn't display last cell

In my storyboard, I have a View controller (embedded in a navigation controller). Inside the view controller I have a tab bar controller, and inside a tab a table view controller. My problem is that the last row of the table view goes "under" the tab bar of the tab bar controller. This didn't happen if i build my app for iOS 6.

How can I solve this? Thank you!

like image 771
carlodonz Avatar asked Sep 26 '13 15:09

carlodonz


4 Answers

Try setting your tabbar translucent property.

self.navigationController.navigationBar.translucent= NO; // Set transparency to no and

self.tabBar.translucent= NO; //Set this property so that the tab bar will not be transparent

like image 63
Priyatham51 Avatar answered Oct 02 '22 12:10

Priyatham51


The accepted and upvoted answers don't work for my setup:

UITabBarController -> UINavigationController -> UIViewController -> UITableView

My app's root view controller is a UITabBarController. Every tab is a UINavigationController, and in one tab, the navigation controller's root is a UIViewController with a table view as the main view.

So here's what worked for me: When alloc-initing the UITableView, I compute for the height and set it in the table view's frame. The general formula is screen height - (status bar height + nav bar height + tab bar height).

like image 25
MLQ Avatar answered Oct 02 '22 12:10

MLQ


This, as said, will work perfectly. I've just tested it.

self.tabBar.translucent = NO;
like image 27
John Maval Avatar answered Oct 02 '22 14:10

John Maval


I think it has to do with automaticallyAdjustsScrollViewInsets not being applied (or applied correctly) due to the nested structure of your view controller hierarchy.

Try and copy your table into a new UIViewController and make sure the checkmark in the UIViewController's identity inspector called "Adjust Scroll View Insets" is turned on.

like image 29
Wirsing Avatar answered Oct 02 '22 14:10

Wirsing