我想在触摸时隐藏导航栏和标签栏并移动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.
}];
请帮助我,谢谢。
答案 0 :(得分:0)
我们为UITableView
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
为此隐藏标题,只返回0。