Header Displaced in TableView with UIRefreshControl

前端 未结 5 1062
暗喜
暗喜 2020-12-09 08:33

My UIRefreshController is doing something odd. When I pull-down refresh, the tableView headers are displaced.

If I pull-down it looks fine, but if I scroll down the

5条回答
  •  北海茫月
    2020-12-09 09:03

    Try this way to add push view controller.

    Create a table view controller and add it as the sub view of existing view controller. Then assign your table view and refresh controllers to tableview controller's properties.

    UITableViewController *newTableViewController = [[UITableViewController alloc] init];
    newTableViewControler.tableView = ;
    
     = [[UIRefreshControl alloc] init];
    [ addTarget:self
                                action:@selector(refreshTableView:)
                      forControlEvents:UIControlEventValueChanged];
    
    newTableViewController.refreshControl = _chatListRefreshControl;
    [self addChildViewController:newTableViewController];
    

提交回复
热议问题