2
因此,此問題的各種迭代似乎已在本網站上多次提出過,但它們都不適用於我的情況。所以我有一個登錄屏幕,在登錄成功後可以翻到導航控制器。當它翻轉到導航視圖時,導航欄一直位於頂部,然後在動畫完成後向下移動。這不會在導航欄上方創建奇怪的空白區域,因爲導航欄在動畫期間開始嵌入狀態欄中。我已經檢查過這兩個視圖控制器有問題的狀態欄啓用,所以我不知道我需要做什麼來解決這個奇怪的問題。使用UINavigationController時,表格視圖向下移動
這裏是我正在切換
-(void) swapToNavController
{
[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:1.25];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
UIViewController *coming = nil;
UIViewController *going = nil;
UIViewAnimationTransition transition;
coming = eventsNavController;
going = viewController;
transition = UIViewAnimationTransitionFlipFromRight;
[UIView setAnimationTransition: transition forView:self.window cache:YES];
[coming viewWillAppear:YES];
[going viewWillDisappear:YES];
[going.view removeFromSuperview];
[self.window insertSubview: coming.view atIndex:0];
[going viewDidDisappear:YES];
[coming viewDidAppear:YES];
[UIView commitAnimations];
}