在我的 Root View 中,我创建了一个导航 Controller 并将其添加到状态栏下方 20 像素处。
我的导航 View Controller
状态栏显示正常。
当我点击“返回”时,(屏幕截图卡住动画)。
当动画发生时 View 向上移动。和 完成后,状态栏会重新出现。
代码:这是我将导航 Controller 添加到我的 VC 的方式
在 Root View 中:
navController = [[UINavigationController alloc]initWithRootViewController:myView];
navController.navigationBar.translucent = YES;
navController.view.autoresizingMask = UIViewAutoresizingNone;
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
CGRect frame=navController.view.frame;
frame.origin.y += 20;
frame.size.height-=20;
navController.view.frame=frame;
}
最佳答案
所以我相信这是你的问题
frame.origin.y += 20;
frame.size.height-=20;
navController.view.frame=frame;
每次您的 View 加载时都会调用它。我相信如果你多次前进和后退,你的 window 就会升起。是吗?如果是。确保只调用一次。
希望对你有帮助
关于ios - Navigation Bar 向上移动,同时 Navigation Controller 弹出动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37228863/