2014-03-02 5 views
0

현재 상태 표시 줄 스타일을 밝은 내용으로 설정하는 응용 프로그램이 있습니다.전체 화면 UIViewController에 대한 StatusBarStyle

[UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; 

전체 화면 모달 창을 제외하고 예상대로 작동합니다. 여기에 모달의 UIViewController를 생성하는 코드는 다음과 같습니다

@implementation PostCard 
- (id)initWithToRecipients:(NSArray *)toRecipients subject:(NSString *)subject message:(NSString *)message isHTML:(BOOL)isHTML 
{ 
    if ([MFMailComposeViewController canSendMail] && (self = [super init])) 
    { 
     self.viewController = [MFMailComposeViewController new]; 
     self.viewController.mailComposeDelegate = self; 

     [_viewController setToRecipients:toRecipients]; 
     [_viewController setSubject:subject]; 
     [_viewController setMessageBody:message isHTML:isHTML]; 

     self.viewController.modalPresentationStyle = UIModalPresentationFullScreen; 
     self.viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; 
    } else { 
     NSLog(@"Cannont send mail from current device."); 
    } 

    return self; 
} 
... 
@end 

엽서의 뷰 컨트롤러가 다음 전체 화면 모드에서

[myOtherViewController presentViewController:myPostCard.viewController animated:YES completion:nil]; 

, 어두운 내용에 statusBarStyle 되돌립니다로 제시됩니다. modalPresentationStyleUIModalPresentationFormSheet으로 변경하면 조명 내용이 보존됩니다.

모달 창의 'statusBarStyle`을 프로그래밍 방식으로 설정하는 방법이 있습니까? 아니면 제시 UIViewController에서 상속을 말해? 아니면이 버그입니까? (참고로, 나는 또한 성공없이 프로젝트 속성을 설정하려고 시도했습니다.)

미리 감사드립니다.

답변

-1
- (UIStatusBarStyle)preferredStatusBarStyle 
{ 
    return UIStatusBarStyleLightContent; 
}