2013-04-23 113 views
0

我想隱藏導航欄和tabbar觸摸並在uitableview上移動,吹碼: _headView viewForHeaderInSection它沒有問題。 但有時塊執行後,_headView可見如何在UITableView上隱藏section的headView?

if(_headView) 
    _headView.hidden = YES; // 
[UIView animateWithDuration:0.5 animations:^{ 
    scrollView.frame = rect; 
    _vc.navigationController.navigationBar.top -= navigationBarHeight; 
    tabView.top = SCREEN_HEIGHT; 

} completion:^(BOOL finished) { 
}]; 

如果是我,它的運行OK隱藏代碼移到完成塊,但0.5秒後隱藏,它是慢慢來。

[UIView animateWithDuration:0.5 animations:^{ 
    scrollView.frame = rect; 
    _vc.navigationController.navigationBar.top -= navigationBarHeight; 
    tabView.top = SCREEN_HEIGHT; 

} completion:^(BOOL finished) { 
    if(_headView) 
     _headView.hidden = YES; //Delay after 0.5s. 
}]; 

請幫助我,謝謝。

+0

我爲我的英語不好 – xuanwenchao 2013-04-23 02:34:10

+0

在休息時突然快速的向上滑動 – xuanwenchao 2013-04-23 02:55:05

+1

剛剛成立的頭高度爲零抱歉,該頭要隱藏.. – vishy 2013-04-23 05:04:54

回答

0

我們有部分的設置高度的委託方法UITableView

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 

只是這回0,隱藏標題。