有没有办法让最后一个部分标题可滚动到顶部?

基本上我有部分标题的完整默认行为。我只希望用户可以将最后一个部分标题滚动到最顶部。 例如,您有一个表格,其中行的像素高度为44像素。表的高度约为500像素。 如果最后一个部分只有2个条目,您将无法将此部分滚动到表格的最顶部,从而将上一部分标题保留在顶部,最后一部分标题保留在屏幕中间,显示最后一节的最后两行。 我喜欢它,所以用户可以将最后一个部分标题滚动到顶部 - 如果最后一部分只包含几行,则为表格的下半部分留空行(如果需要)。 这是可能吗?     
已邀请:
是的......... 你要做的就是为表视图设置
contentInset
....
[yourTableView setContentInset:UIUIEdgeInsetsMake(0,0,yourScrollableHeight,0)];
** ***更新 以下是最后一节中了解单元格的步骤...(
cellForRowAtIndexPath
code)
int numberOfSections = [yourTableView numberOfSections];
if(it's last section... [indexPath.section == numberOfSections-1])
{
  int numberOfRowsInLastSection = [yourTableView numberOfRowsInSection:indexPath.section];
  //default height of row is .. 44px...
  // now I hope you can calculate this......
  //and here use above line of code for setting scroll behavior...
}
谢谢,     

要回复问题请先登录注册