2009-06-09 6 views

답변

4

당신은 ..

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 
{ 
    return 30; 
} 


- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section  
{ 
    UIView *v = [[UIView alloc] init]; 
    [v setBackgroundColor:[UIColor blackColor]]; 
    return [v autorelease]; 
} 

이 무료로 양손 그래서 오타를 용서했다, 등 사용

UPDATE가 필요합니다 '그룹화'테이블이 경우에만 작동합니다. 테이블이 그룹화되었거나 정상입니까?

0

예. 그것은 UIView의를 반환으로

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section 

, 당신은 당신이 좋아하는 무엇으로 설정할 수 있습니다하거나

[UIView setBackgroundColor:UIColor];

: UITableViewDelegate 프로토콜의 방법을 사용하여 HeaderInSection 사용자 지정
관련 문제