在
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
方法里,怎样获取到cell所在的sectionHeader以改变颜色?
可以通过indexPath获取section,然后刷新该section,在headerView的代理里面设置条件就可以更换颜色
-
(nullable UIView )tableView:(UITableView )tableView viewForHeaderInSection:(NSInteger)section{
1.实例化一个 view 2.改变view.backgroundColor 3.返回这个view return view;
}