HardikDabhi
HardikDabhi

Reputation: 2952

How To Create Custom view That looks like Alert View?

I am creating one custom uiview control that looks like alert view. I have user RKRichtexteditor on my custom control. I can not add my view inside alert control because alert control size is fixed.

My question is

when I have pressed button my custom view will shows just like alert view. I have done with using blur effect, I have facing one problem. My problem is my tab bar is not blur.

Image

enter image description here

Code is
=======
self.view.backgroundColor = [UIColor clearColor];

    self.blureEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
    self.visualEffectView = [[UIVisualEffectView alloc] initWithEffect:self.blureEffect];
    self.visualEffectView.frame = self.view.bounds;
    self.visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

    [self.view addSubview:self.visualEffectView];

How to blur my tab bar when my custom control is open. please help me guys or give me any link.

Thank you in advance.

Upvotes: 1

Views: 509

Answers (1)

Sargis
Sargis

Reputation: 1334

Use this.

    self.blureEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
    self.visualEffectView = [[UIVisualEffectView alloc] initWithEffect:self.blureEffect];
    self.visualEffectView.frame = self.view.bounds;
    self.visualEffectView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

    [[[UIApplication sharedApplication] keyWindow] addSubview:self.visualEffectView];

Upvotes: 2

Related Questions