0

I am making a custom alertView similar like standard alertView in iOS.

for making block effect , I did this

UIView * backgroundView = [[UIView alloc] initWithFrame: CGRectMake(0, 0, screenWidth, screenHeight)];

backgroundView.backgroundColor = [UIColor blackColor];
backgroundView.alpha = 0.4f;
[view addSubview:backgroundView];

it works similar like showing standard alert.

but It doesn't works in Tabbar's Area.

How do I ?

[Before showing alert View] enter image description here [standard alertView Image] enter image description here

[cutom alertView Image] enter image description here

석진영
  • 243
  • 4
  • 13

2 Answers2

0

Add backgroundView to UIWindow and bring backgroundView to front.

[[[[UIApplication sharedApplication] delegate] window] addSubview:backgroundView]
Keith Ellis
  • 26
  • 1
  • 2
0

Make sure that you add backgroundView on the top.

UIWindow* mainWindow = [[UIApplication sharedApplication] keyWindow];
[mainWindow addSubview: backgroundView];
Reming Hsu
  • 2,215
  • 15
  • 18