我的iPhone应用程序有一个小问题。在我的UIView笔尖上,在调用中状态栏出现后,视图的大小没有正确调整。具体来说,导航栏的顶部隐藏在状态栏的下面。
这三个图像显示了呼叫状态栏中的before、during和after。我的问题显示在最后一张图片中。图像
我使用以下代码调用笔尖:
- (IBAction)showMapClicked:(id)sender
{
if (childController == nil) {
childController = [[MapViewController alloc] initWithNibName:@"MapViewController" bundle:nil];
}
[self.navigationController pushViewController:childController animated:YES];
}
我发现了这个问题,但它似乎没有涵盖我的问题:调整通话中状态栏的大小
感谢您对如何修复的任何见解。
我已经设法解决了这个问题。我用这个代码隐藏页面上的标签栏,它把页面顶部搞砸了:
CGRect bounds = [[UIScreen mainScreen] bounds];
CGRect tabBarFrame = self.tabBarController.tabBar.frame;
self.tabBarController.view.frame = GRectMake(0, 0, bounds.size.width, bounds.size.height+tabBarFrame.size.height);
我应该做的是实现这个:
- (BOOL)hidesBottomBarWhenPushed {
return YES;
}