0

タッチ時にナビゲーションバーとタブバーを非表示にしてuitableviewに移動したい、コードを吹き飛ばしたい:viewForHeaderInSectionからの_headViewそれは問題ありません。ただし、ブロックが実行された後、_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) {
}];

非表示コードを完了ブロックに移動すると、正常に実行されますが、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.
}];

助けてください、ありがとう。

4

1 に答える 1

0

セクションの高さを設定するデリゲート メソッドがあります。UITableView

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

ヘッダーを非表示にするために、これに対して 0 を返すだけです。

于 2013-04-23T10:32:00.377 に答える