首页 文章

顶部栏在iPhone5中可见,但在iPhone6中不可见

提问于
浏览
0

我在模拟器iPhone5和iPhone6上运行我的代码 . 问题是顶部栏在iPhone5中可见,但在iPhone6或iPhone6中不可见 . 请参阅获得的图片 .

enter image description here

enter image description here

可能是什么问题?

按照以下步骤设置顶部导航颜色

  • 在信息部分中进行了一些更改
    enter image description here

  • 以下代码我已添加到我的应用程序委托文件中

navigationController.navigationBar.translucent = NO; [navigationController.navigationBar setTintColor:[UIColor whiteColor]]; [[UINavigationBar外观] setBarTintColor:[UIColor blackColor]]; [[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor whiteColor],nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName,nil]]];

1 回答

  • 1

    在info.plist中将UIViewControllerBasedStatusBarAppearance设置为NO .

    呼叫

    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    

    在应用程序中完成了启动方法 .

    并删除其他一切 .

相关问题