2014-06-20 32 views
0

我忽略了方法viewForHeaderInSection,我默認實現它將它添加到UItableView之上,我想將它發送到tableView的後面。任何想法?viewForHeaderInSection將標題放在表格上方

這裏是我的代碼:

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ 
    UIImageView *imageView = [[UIImageView alloc] initWithImage:districtImage]; 
    imageView.frame = CGRectMake(10,10,300,100); 
    NSLog(@"districtImage=%@",districtImage); 
    return imageView; 
} 

編輯

好吧我現在向上滾動:

self.tableView.tableHeaderView = ImageView的;

我現在的問題是標題是大我怎麼能減少它

- (CGFloat的)的tableView:(UITableView的*)的tableView heightForHeaderInSection:(NSInteger的)部分{}

似乎並沒有採取影響。

回答

0

只需使用

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

與同體,應該工作

+0

@WarehouseMuzik因爲標題中的視圖被放置在部分的頂部,但對於頁腳中的觀點是在的結束部分。這不是你的問題嗎? – fabf98dev

+0

不,我已經有一個頁腳,所以它沒有幫助,我現在正在工作,但是頁眉和tableView之間存在差距 – WarehouseMuzik

+0

對不起,我誤解了你的問題 – fabf98dev

相關問題