UIModalPresentationCurrentContext with Transition?

后端 未结 3 1309
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 04:41

I am trying to modal present a view controller like below:

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@\"MainStoryboard\" bundle:nil];
UIVie         


        
3条回答
  •  死守一世寂寞
    2020-12-14 05:00

    Full screen modals aren't supposed to allow you to see the under layer. Annoying I know.

    From your code I'm assuming that "addPopover" is actually a full screen view, where you have your content as a subsection while the rest is transparent.

    Try this:

    vc.modalPresentationStyle = UIModalPresentationCurrentContext;
    vc.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
    [self presentViewController:vc animated:YES completion:NULL];
    

    Note: I'd recommend adding a low alpha background color to let the user know that they can't interact with the rest of the view when you pop this over top...

提交回复
热议问题