OGeek|极客世界-中国程序员成长平台

标题: iphone - iOS通话状态栏覆盖顶部导航栏 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-13 12:04
标题: iphone - iOS通话状态栏覆盖顶部导航栏

我的 iPhone 应用程序有一个小问题。在我的 UIView Nib 上,通话状态栏出现然后消失后, View 无法正确调整大小。具体来说,导航栏的顶部隐藏在状态栏的下方。

这三张图片显示了通话前、通话中和通话后的状态栏。我的问题显示在最后一张图片中。 Images

我使用以下代码调用 Nib :

- (IBAction)showMapClickedid)sender 
{
    if (childController == nil) {
        childController = [[MapViewController alloc] initWithNibName"MapViewController" bundle:nil];
    }

    [self.navigationController pushViewController:childController animated:YES];
}

我发现了这个 SO question,但它似乎没有涵盖我遇到的问题: Resize for in-call status bar

感谢您提供有关如何修复的任何见解。



Best Answer-推荐答案


我已经设法解决了这个问题。我正在使用此代码隐藏页面上的标签栏,它弄乱了页面顶部:

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 { 返回是; }

关于iphone - iOS通话状态栏覆盖顶部导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9599560/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://sqlite.in/) Powered by Discuz! X3.4