search

Home  >  Q&A  >  body text

objective-c - iOS开发过程中大家遇到过这样的打印信息吗

<Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
PHP中文网PHP中文网2758 days ago434

reply all(1)I'll reply

  • 世界只因有你

    世界只因有你2017-05-02 09:20:34

    The old method is used to set the status bar style of the app. In the info.plist, the View controller-based status bar appearance is set to NO, and the default is YES. This method is generally used for iOS6, and also for iOS7 and 8. Compatible, but a warning was reported when iOS9 arrived.

    Delete the original setting code

    //设置状态栏的白色
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    

    In the Xcode project file settings, set View controller-based status bar appearance to YES, and then use the new method to implement the status bar style.

    Write the following method in your custom navigation controller:

    //设置状态栏的(亮色)白色
    -(UIStatusBarStyle)preferredStatusBarStyle
    {
        return UIStatusBarStyleLightContent;
    }
    

    Clean or delete the application and re-run
    Warning elimination

    reply
    0
  • Cancelreply