Reach the end of the tableview without using 'numberOfRowsInSection' delegate method iphone sdk

痞子三分冷 提交于 2019-12-25 01:48:27

问题


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)]; 


来源:https://stackoverflow.com/questions/2912217/reach-the-end-of-the-tableview-without-using-numberofrowsinsection-delegate-me

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!