Tab bar covers UITableView's last cell

后端 未结 12 1874
挽巷
挽巷 2020-12-16 01:18

I\'m developing an application based on the Tab Bar application preset. In one of the tabs I have a table view showing a lot of data, but half the last cell in the table vie

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-16 01:46

    There are a couple of solutions for this.

    1.) Assuming that you are using translucent tool bars, you have to make the tool bars opaque.

    2.) If you are using StoryBoard and you are putting a TableView inside your ViewController, assuming it's a ViewController and not a TableViewController.

    3.) You can manually add padding/spacing.

    if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
    {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = YES;
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    

    or

    UIEdgeInsets insets = UIEdgeInsetsMake (0,sizeOfTableView - sizeOfTabBar, 0, 0);
    self.tableView.contentInset = inset;
    self.tableView.scrollIndicatorInsets = inset;
    

    Hope this helps & Happy coding!

提交回复
热议问题