Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parent View become blurred after dismissing RNBlurModalView #40

Open
tyegah opened this issue Mar 6, 2014 · 3 comments
Open

Parent View become blurred after dismissing RNBlurModalView #40

tyegah opened this issue Mar 6, 2014 · 3 comments

Comments

@tyegah
Copy link

tyegah commented Mar 6, 2014

I use the library to show a modal view with buttons inside. If any of the buttons is clicked, it will dismiss the RNBlurModalView (by calling [modalView hide]) and show a standard modal view. After dismissing the standard modal view, the parent view is being shown. but when I display another standard modal view from the same parent view and dismiss it, the whole parent view becomes blurred.

Is there anyone out there facing this issue?

@ansani
Copy link
Contributor

ansani commented Mar 6, 2014

Hi!
Did you use latest release from GitHub ? I fixed a similar BUG about blurred parent view.
Can you attach some code example ?
Tnx

(My fix: #22)

@tyegah
Copy link
Author

tyegah commented Mar 7, 2014

Hi @ansani ,
Thank you for replying.

I think I am using the latest release, I've downloaded it a few weeks ago.
Here's my code

@interface MyController ()

@Property (strong, nonatomic) RNBlurModalView *modalView;

@EnD

And here's how I present and dismiss the modal view

//present the modal view

 UIView *checkOutView = [[UIView alloc] initWithFrame:CGRectMake(0,0,400,250)];
    checkOutView.backgroundColor = [UIColor lightGrayColor];
    UILabel *lblCheckOut = [[UILabel alloc] initWithFrame:CGRectMake(checkOutView.frame.size.width/2 - 125, 15, 250, 25)];
    lblCheckOut.text = @"Checkout";
    lblCheckOut.textAlignment = NSTextAlignmentCenter;
    lblCheckOut.textColor = [UIColor blackColor];
    [checkOutView addSubview:lblCheckOut];

    UIButton *btnPurchase = [[UIButton alloc] initWithFrame:CGRectMake(checkOutView.frame.size.width/2 - 125, 65, 250, 35)];
    [btnPurchase setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:200/255.0 alpha:1.0] forState:UIControlStateNormal];
    [btnPurchase setTitle:@"Purchase" forState:UIControlStateNormal];
    [btnPurchase addTarget:self action:@selector(purchaseClicked:) forControlEvents:UIControlEventTouchUpInside];
    btnPurchase.backgroundColor = [UIColor whiteColor];
    [checkOutView addSubview:btnPurchase];

    UIButton *btnRedemption = [[UIButton alloc] initWithFrame:CGRectMake(checkOutView.frame.size.width/2 - 125, 115, 250, 35)];
    [btnRedemption setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:200/255.0 alpha:1.0] forState:UIControlStateNormal];
    [btnRedemption setTitle:@"Redemption" forState:UIControlStateNormal];
    [btnRedemption addTarget:self action:@selector(redemptionClicked:) forControlEvents:UIControlEventTouchUpInside];
    btnRedemption.backgroundColor = [UIColor whiteColor];
    [checkOutView addSubview:btnRedemption];

    UIButton *btnTimeStamptOut = [[UIButton alloc] initWithFrame:CGRectMake(checkOutView.frame.size.width/2 - 125, 165, 250, 35)];
    [btnTimeStamptOut setTitleColor:[UIColor colorWithRed:36/255.0 green:71/255.0 blue:200/255.0 alpha:1.0] forState:UIControlStateNormal];
    [btnTimeStamptOut setTitle:@"Time Stamp Out" forState:UIControlStateNormal];
    [btnTimeStamptOut addTarget:self action:@selector(timeStampOutClicked:) forControlEvents:UIControlEventTouchUpInside];
    btnTimeStamptOut.backgroundColor = [UIColor whiteColor];
    [checkOutView addSubview:btnTimeStamptOut];

    self.modalView = [[RNBlurModalView alloc] initWithViewController:self view:checkOutView];
    [self.modalView show];

///dismiss the modal view

if([self.modalView isVisible])
{
[self.modalView hide];
NSLog(@"modal view being hide");
}

Is there anything wrong in my code?

@tyegah
Copy link
Author

tyegah commented Mar 7, 2014

Okay, I found out that setting the modalView to nil after dismissing it fixed the problem.

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

No branches or pull requests

2 participants