0

Created 3 tab bar items, which are tableViewController, from a tabBarController. However, the scroll in each of those tableViewControllers is behaving weird. Issues noted are:

1) In Portrait Mode for all the tab items, scroll view does not show up until the last cell (out of 30, only 24 cells are showing up), and scroll bar shows it reached the end of page.

2) In Landscape Mode, all the cells, including the last cell is showing up with the scroll. But, the Last cell is getting hidden behind the scroll.

3) Once I turn to Portrait Mode, I am again able to scroll till the last cell with last cell getting hidden behind the tab bar.

Please let me know the fixes.

TeKnofUNk
  • 531
  • 1
  • 7
  • 9

1 Answers1

0

Try this

UIEdgeInsets adjustForTabbarInsets = UIEdgeInsetsMake(0, 0, CGRectGetHeight(self.tabBarController.tabBar.frame), 0);
tblview.contentInset = adjustForTabbarInsets;
tblview.scrollIndicatorInsets = adjustForTabbarInsets;

refer link : Tab Bar covers TableView cells in iOS7

Community
  • 1
  • 1
KKRocks
  • 8,222
  • 1
  • 18
  • 84
  • I placed the code under the viewDidLoad() method and its showing multiple errors. This did not really help me. I tried with all the solution in the reference link and even tried adjusting the tab bar settings. – TeKnofUNk Oct 21 '16 at 06:10
  • 'UIEdgeInsets adjustForTabbarInsets = UIEdgeInsetsMake(0, 0, CGRectGetHeight(self.tabBarController?.tabBar.frame), 0)’ itself is giving this error “Consecutive statements on a line must be separated by ; – TeKnofUNk Oct 21 '16 at 06:34
  • it is working fine in my project . but don't know what is the problem occurs there . – KKRocks Oct 21 '16 at 06:42
  • I did use the below one – TeKnofUNk Oct 21 '16 at 07:21
  • self.edgesForExtendedLayout = .all self.tableView.contentInset = UIEdgeInsetsMake(0, 0, (self.tabBarController?.tabBar.frame)!.height, 0) – TeKnofUNk Oct 21 '16 at 07:21
  • self.edgesForExtendedLayout = .all self.tableView.contentInset = UIEdgeInsetsMake(0, 0,(self.tabBarController?.tabBar.frame)!.height, 0) – TeKnofUNk Oct 21 '16 at 07:22
  • Sorry for messing up the comments section.. I used the code above which did not give me any error. But, it did not resolve the problem. I found a way to fix Number 2, but 1 & 2 are looking the same. – TeKnofUNk Oct 21 '16 at 07:23
  • ok this method called in - (void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; } .for all Number which are mentioned in questions . – KKRocks Oct 21 '16 at 07:30
  • I fixed the issue after removing the below rows. tableView.rowHeight = UITableViewAutomaticDimension //tableView.estimatedRowHeight = 80 – TeKnofUNk Oct 24 '16 at 08:02