How can i add a activity indicator below the UITableView?

后端 未结 4 1526
自闭症患者
自闭症患者 2020-12-28 17:22

In my application i want to add activity indicator under UItableview where tableview will scroll but i do not know how can i add activity indicator over there.

To el

4条回答
  •  滥情空心
    2020-12-28 17:49

    This is how I've done it:

    UIActivityIndicatorView *spinner = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease];
    [spinner startAnimating];
    spinner.frame = CGRectMake(0, 0, 320, 44);
    self.tableView.tableFooterView = spinner;
    

    Then you just set tableFooterView to nil to remove it.

    Note: 44, btw, is the default height of a UITableViewCell when using UITableViewStylePlain. It's 45 for UITableViewStyleGrouped.

提交回复
热议问题