简体   繁体   中英

Black Screen in Xcode 6 and 6.1

I have presented a modal view controller using segue, it works fine in iOS8 but gives the black screen in iOS 7.

Modal Presentation style is "Over Current Context".

I've cleared the background colour of the Modal View Controller so that the presenting view controller is visible.

There is a solution to this! I've used the following code in two projects, and it works for both iOS8 and iOS7:

modal.modalPresentationStyle = UIModalPresentationOverCurrentContext;
self.navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
[self.navigationController presentViewController:modal animated:YES completion:nil];

The trick is to set the modal's modalPresentationStyle to UIModalPresentation Over CurrentContext, and the navigationController's modalPresentation style to regular ole UIModalPresentationCurrentContext.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM