tableView.contentInset broken on iOS 7

后端 未结 1 2054
逝去的感伤
逝去的感伤 2021-02-19 16:31

Setting the contentInset on a UITableView doesn\'t seem to work on iOS 7:

self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0); 
// Works on iOS 6, nothi         


        
1条回答
  •  野性不改
    2021-02-19 16:57

    Moving this code into the view controller's -viewDidLayoutSubviews method fixed this for me.

    -(void)viewDidLayoutSubviews {
        [super viewDidLayoutSubviews];
        self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0); 
    }
    

    Thanks Apple for your non-existent documentation on this!

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