Reach the end of the tableview without using '

2019-08-26 18:48发布

问题:

I want to add a view after the last cell of tableview. I need to define the frame for it. If I want to add something before the first cell, then I can set the frame as

refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.view.bounds.size.height,320.0f, self.view.bounds.size.height)];

But how to find the y coordinate of the frame of view to be set after the last cell.

Thanx in advance.

回答1:

The tableview subclasses scrollView, so, to answer your question, you can use contentSize, however, can you use the footerView to achieve what you want anyway ?



回答2:

Use the code:

refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, self.tableView.contentSize.height, 320.0f, self.tableView.bounds.size.height)];