改變?nèi)縯ableview 的headerfooterview背景顏色 通過各種嘗試 運(yùn)行時谍椅、基類調(diào)用
-(void)tableView:(UITableView*)tableView willDisplayFooterView:(UIView*)view forSection:(NSInteger)section{view.backgroundColor=[UIColor clearColor];}
-(void)tableView:(UITableView*)tableView willDisplayFooterView:(UIView*)view forSection:(NSInteger)section{UITableViewHeaderFooterView*footer=(UITableViewHeaderFooterView*)view;footer.contentView.backgroundColor=[UIColor redColor];}
等無效。
使用:
-(void)tableView:(UITableView*)tableView willDisplayFooterView:(UIView*)view forSection:(NSInteger)section{view.tintColor=[UIColor clearColor];}
基類中獲取tableview(統(tǒng)一設(shè)置tablefooterview 避免多余的分割線)避免獲取不到報(bào)錯 實(shí)現(xiàn)方法:
-(id)valueForUndefinedKey:(NSString *)key{
? ? NSLog(@"出現(xiàn)異常秉馏,該key不存在%@",key);
? ? return nil;
}