Good time. I am writing an application for iOS. To output one UIViewController in another, I use the presentPopupViewController method. The problem is that all the rest around the new controller is very much obscured (black color on the simulator). How to get rid of this blackout? Call code:

MyDropDown* mdd = [[MyDropDown alloc] initWithNibName:@"MyDropDown" bundle:nil]; [self presentPopupViewController:mdd animationType:MJPopupViewAnimationSlideTopTop]; 
  • Could you at least write that your presentPopupViewController is a method from a library with a github? - Max Mikheyenko

2 answers 2

Solved the problem like this:

 id bcg = self.mj_popupBackgroundView; UIView *bcgView = bcg; bcgView.backgroundColor = [UIColor clearColor]; 

    You need to take the same MJPopupViewController that you use for your popup from the githab, and delete the following lines in the UIViewController+MJPopupViewController.m file:

     // customize popupView popupView.layer.shadowPath = [UIBezierPath bezierPathWithRect:popupView.bounds].CGPath; popupView.layer.masksToBounds = NO; popupView.layer.shadowOffset = CGSizeMake(5, 5); popupView.layer.shadowRadius = 5; popupView.layer.shadowOpacity = 0.5; popupView.layer.shouldRasterize = YES; popupView.layer.rasterizationScale = [[UIScreen mainScreen] scale]; 
    • This code is responsible for the shadow cast by the controller. I would not particularly like to edit the library itself. Plus, I'm not experienced enough in ObjC. - Matvey
    • Well, then immediately after the popup is created manually, remove all the manipulations with the railer - the same code from the answer, but vice versa. - Max Mikheyenko