Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Press close button- still show fade background #49

Open
gran33 opened this issue Oct 23, 2013 · 8 comments
Open

Press close button- still show fade background #49

gran33 opened this issue Oct 23, 2013 · 8 comments

Comments

@gran33
Copy link

gran33 commented Oct 23, 2013

Hi,

When i invoke:
[self dismissPopupViewControllerWithanimationType:MJPopupViewAnimationFade];
From my popup, the popup dismiss, but the background ViewController still fade.

How can i fix it?

10x in advance!

Ran

@raid5
Copy link

raid5 commented Jan 6, 2014

+1, I'm seeing this as well.

@benaneesh
Copy link

+1, use NSNotificationCenter as a quick hack for now

@Paludis
Copy link

Paludis commented Mar 28, 2014

Also seeing this

@feef
Copy link

feef commented May 12, 2014

The problem appears to be from using "- (void)presentPopupViewController:(UIViewController*)popupViewController animationType:(MJPopupViewAnimation)animationType" to present a view controller with a view that is the full size of the screen. It appears that the project is expecting your viewcontroller's root view to be only the size of the content inside. So, if you're making a view controller and adding a subview to that view controller's view, you must also resize your view controller's view property to be exactly the size of the subview you want to show.

Also, another little note, if you dismiss from a different view controller than you presented from, the background darkness will not properly fade with the rest of the foreground view. For proper appearance, you MUST present and dismiss from the same view controller.

@revisedagain
Copy link

Maybe this workaround will help you guys out in:

  • (void)slideViewOut:(UIView_)popupView sourceView:(UIView_)sourceView overlayView:(UIView*)overlayView withAnimationType:(MJPopupViewAnimation)animationType

set up NSnotificationcenter IE:

[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(handleNotification:)
name:@"slideOutDone"
object:nil];

fire it in the animation completion:

    [[NSNotificationCenter defaultCenter]
     postNotificationName:@"slideOutDone"
     object:self]; 

your handler will be something like:

-(void)handleNotification:(NSNotification *)pNotification
{
[dismissButton sendActionsForControlEvents:UIControlEventTouchUpInside];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}

@tracy-e
Copy link

tracy-e commented Jul 1, 2014

+1

@hoangnn89
Copy link

Send notification to presenting view controller to dismiss will help :)

@SyedIsmailAhamed
Copy link

There is a simple fix for this, hope it helps some one,

create a sample delegate in the view controller which is about to be presented

in this case Test View Controller is the view controller which am presenting

/** Test View Controller .h**/
@interface TestViewController : UIViewController<UITableViewDataSource,UITableViewDelegate>
{
id delegate;
}
@Property (nonatomic, assign) id delegate;

/Test View Controller.m/

//button action to dismiss

  • (IBAction)okButtonTapped:(id)sender {
    [self.delegate dismissPopupViewControllerWithanimationType:MJPopupViewAnimationSlideTopBottom];
    }

//while presenting don't forget to set delegate/

TestViewController* previewVC=[[TestViewController alloc]init];
previewVC.delegate=self;
[self presentPopupViewController:previewVC animationType:MJPopupViewAnimationSlideTopBottom dismissed:nil];

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants