UITableview not visible the last cell when scroll down

后端 未结 5 940
情话喂你
情话喂你 2020-12-08 08:39

I\'m very new to iOS. I have a UITableView that filled with many custom cells, but the bottom cell is is not visible properly when scroll down.my Y value of the UITableView

相关标签:
5条回答
  • 2020-12-08 09:00

    If you are on iOS7 and using a navigation controller toolbar, make sure to set it to translucent:

        self.navigationController.toolbar.translucent = NO;
    
    0 讨论(0)
  • 2020-12-08 09:02

    For me this is worked.

    I have commented out my code

    -(void)viewWillLayoutSubviews
    {
    dispatch_async(dispatch_get_main_queue(), ^{
        //This code will run in the main thread:
        CGRect frame = tableViewObj.frame;
        frame.size.height = tableViewObj.contentSize.height;//commenting this code worked.
        tableViewObj.frame = frame;
    
    });
    
    }
    

    That's it. It worked for me. Please make sure you have not changed tableview frame some where while in implementation file.

    0 讨论(0)
  • 2020-12-08 09:08

    it is because you set your tableview's frame wrong, if your view has a navigation bar , usually use this code:

    CGRect frame = self.view.bounds;
    frame.height -= 44;
    

    44 is the height of your navigation bar.

    0 讨论(0)
  • 2020-12-08 09:12

    If you have a status bar visible on the top, then it will occupy 20px which will push down your tableView by the same. To avoid this, make the tableView height 460 instead of 480.

    0 讨论(0)
  • 2020-12-08 09:18

    Use -

      tableView.contentInset = UIEdgeInsetsMake(0, 0, 120, 0); //values
    

    passed are - top, left, bottom, right

    Pass bottom offset as per your needs.

    0 讨论(0)
提交回复
热议问题