presentViewController black background instead of transparent

后端 未结 5 925
栀梦
栀梦 2021-01-18 03:24

I have a view that I wish to present to the user in the standard way (sliding up from the bottom of the screen). About half this view is a transparent background and the bot

5条回答
  •  误落风尘
    2021-01-18 03:58

    I had a similar problem with the black background appearing after a short delay when creating the controller with

        Disclaimer *vc = [[Disclaimer alloc]init];
    

    What solved the problem for me was to create a corresponding object in IB and instantiate the viewcontroller using it's storyboard ID:

         Disclaimer *vc = (Disclaimer *)[self.storyboard instantiateViewControllerWithIdentifier:@"SBIDDisclaimer"];
    [self presentViewController:vc animated:YES completion:nil];
    

    I guess doing it via IB does some additional initialisations.

提交回复
热议问题