MFMailComposeViewController in iOS 7 statusbar are black

前端 未结 13 781
不知归路
不知归路 2020-12-04 23:20

i have a feedback button in my ios 7 application with MFMailComposeViewController. After the user click this button the mailcomposer open but the statusbar changed to black.

相关标签:
13条回答
  • 2020-12-05 00:07

    In my case, I was using "view controller-based status bar appearance" and presenting a modal view controller with a custom segue transition and then presenting the MFMailComposeViewController from there. In this situation, by default, iOS only respects/uses the presenting or "root" view controller's preferredStatusBarStyle method.

    So once I overrode childViewControllerForStatusBarStyle in my root view controller and preferredStatusBarStyle in my modal view controller, everything worked as expected... something like this:

    // in RootViewController.m ...
    - (UIViewController *)childViewControllerForStatusBarStyle {
        return self.modalViewController;
    }
    
    // in ModalViewController.m ...
    - (UIStatusBarStyle)preferredStatusBarStyle {
        if (self.mailController != nil)
            return UIStatusBarStyleDefault;
        return UIStatusBarStyleLightContent;
    }
    
    0 讨论(0)
提交回复
热议问题