TableView Showing Behind Tab Bar

36,322

Solution 1

Try setting

self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.automaticallyAdjustsScrollViewInsets = NO;

Inside the tableview controller

Solution 2

Swift 4.x

let adjustForTabbarInsets: UIEdgeInsets = UIEdgeInsetsMake(0, 0, self.tabBarController!.tabBar.frame.height, 0)
self.yourTableView.contentInset = adjustForTabbarInsets
self.yourTableView.scrollIndicatorInsets = adjustForTabbarInsets

Solution 3

Check the screen shot

enter image description here

Check the under top Bar and Un-checke under Bottom Bar

Solution 4

SWIFT 3

put this inside viewDidLoad of your tableViewController:

self.edgesForExtendedLayout = UIRectEdge()
self.extendedLayoutIncludesOpaqueBars = false
self.automaticallyAdjustsScrollViewInsets = false

Solution 5

Swift 3.0

This is what worked for me. In your Custom ViewController:

override func viewDidLoad() {
    super.viewDidLoad()

    let adjustForTabbarInsets: UIEdgeInsets = UIEdgeInsetsMake(self.tabBarController!.tabBar.frame.height, 0, 0, 0);
    //Where tableview is the IBOutlet for your storyboard tableview.
    self.tableView.contentInset = adjustForTabbarInsets;
    self.tableView.scrollIndicatorInsets = adjustForTabbarInsets;
}
Share:
36,322

Related videos on Youtube

raginggoat
Author by

raginggoat

Updated on May 28, 2021

Comments

  • raginggoat
    raginggoat almost 3 years

    I am updating my app to use iOS 7 and I'm having a problem with a table view. My tab bar is translucent. The problem is when I scroll to the bottom of my table view, part of the last cell is still behind the tab bar. I'd like to have a bit of space between the last cell and the tab bar. I could fix this by using an opaque tab bar instead, but I want to keep it translucent.

    enter image description here

  • Slavcho
    Slavcho about 10 years
    Yes, its working but suddenly my tabBar changed color.
  • Johnykutty
    Johnykutty about 10 years
    can you tell the color change from which color to which color?
  • Slavcho
    Slavcho about 10 years
    Well first was white, and then changed to some gray with gradient. But after manual change to white color, everything is fine. Just wondering why that happened.
  • Litome
    Litome about 7 years
    The edge Inset should be for the bottom though, not the top: let adjustForTabbarInsets: UIEdgeInsets = UIEdgeInsetsMake(0, 0, self.tabBarController!.tabBar.frame.height, 0);
  • towry
    towry almost 7 years
    Not working, the last cell is still behind the tab bar.
  • Dot Freelancer
    Dot Freelancer over 6 years
    how can i uncheck it programmatically? i couldn't do it programmatically
  • inokey
    inokey about 6 years
    Works fine on iOS 11 (both iPhone 7 & iPhone X), doesn't work on iOS 10
  • Yogesh Patel
    Yogesh Patel almost 5 years
    Thanks @Hemang, Working For me but I have another issue when I press In NavigationBar Searchbar it gives me the space between NavigationBar and TableView. if you have any solution for this then please update me. Great Job