2011-09-16 5 views

답변

-17

쓰기이 당신의 UITableViewDelegate 또한

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; 
{ 
    return 100; 
} 
+0

는 감사 만! – Alex

+41

이 솔루션은 섹션 헤더보기 용입니다. tableHeaderView가 아닙니다. – jonsibley

0

다음 코드를 시도했지만 여전히 작동하지 않는 경우 인터페이스 빌더에서 헤더보기 크기를 변경해보십시오.

당신이 당신의 헤더에 대해 원하는 것들과의 UIView를 작성하고 추가보기

UIView *tempView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, heightYouWant)]; 
tempView.backgroundColor = [UIColor whiteColor]; 
[yourTableView setTableHeaderView:tempView]; 
//[yourTableView setTableFooterView:tempView]; you can also use Footer in same way 
[emptyView release]; 

당신은 시간을 실행 만들 수 tempView에 다른 컨트롤을 추가 할 수 있습니다.

18
tableView.tableHeaderView = nil; 
tableView.tableHeaderView = your_headerView; 

페이지로 : Resizing a UITableView's tableHeaderView

+1

이상하게 들리지만 실제로 작동합니다! 왜? –

+0

UITableView 회전 또는 설정 중에 tableHeaderView 높이를 다시 계산하기 때문에 생각합니다. – rowwingman

+0

작동하지 않음 .... @@@ – Nico

관련 문제