在header上加高度为1的阴影
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
UIView *head = [[UIView alloc]initWithFrame:CGRectMake(0, 0, DEVICE_WIDTH, 0.5)];
head.layer.shadowOpacity =0.9f;
head.layer.shadowRadius = 6;
head.layer.shadowOffset = CGSizeMake(1, 1);
CGMutablePathRef squarePath = CGPathCreateMutable();
//让图形的形状为正方形
CGPathAddRect(squarePath, NULL, head.bounds);
//设定阴影图形
head.layer.shadowPath = squarePath;
CGPathRelease(squarePath);
return head;
}
- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
return 1;
}