說(shuō)明:先執(zhí)行第一模塊(3次)、然后執(zhí)行第二模塊(section * row 次)、最后執(zhí)行第三模塊(section 次)
第一模塊:(1執(zhí)行完之后,循環(huán)執(zhí)行2-5 section次),整個(gè)模塊執(zhí)行3次后才執(zhí)行第二模塊
{
1.有幾組 1次 numberOfSectionsInTableView
【
2.組頭高 2次 heightForHeaderInSection
3.組尾高 2次 heightForFooterInSection
4.有幾行 1次 numberOfRowsInSection
5.每行高 row次 heightForRowAtIndexPath
】section次
} 3次
第二模塊:整個(gè)模塊循環(huán)執(zhí)行section*row次之后才執(zhí)行第三模塊
{
6.每行是啥 1次 cellForRowAtIndexPath
7.每行高 1次 heightForRowAtIndexPath
8.已展示行 1次 willDisplayCell
} section * row 次
第三模塊:整個(gè)模塊循環(huán)執(zhí)行section次
{
9.組頭是啥 1次 viewForHeaderInSection
10.已展示組頭 1次 willDisplayHeaderView
11.組尾是啥 1次 viewForFooterInSection
12.已展示組尾 1次 willDisplayFooterView
} section 次
UITableView滾動(dòng)到頂部和滾動(dòng)到底部的處理
if (_dataArr.count > 0) {//滾動(dòng)到頂部
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:1] atScrollPosition:UITableViewScrollPositionTop animated:YES];
}else{//滾動(dòng)到底部
if (self.tableView.contentSize.height > self.tableView.frame.size.height){
CGPoint offset = CGPointMake(0, self.tableView.contentSize.height - self.tableView.frame.size.height);
[self.tableView setContentOffset:offset animated:NO];
}
}