I use keyWindow to add a subView, it add success but did not shows in the front of the screen hierarchy.
The deep gray view is my added view:
My code is:
@interface ViewController ()
{
LMLUpspringView *pop_v;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
pop_v = [[LMLUpspringView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, self.view.bounds.size.height)];
UIWindow *keywindow = [[[UIApplication sharedApplication] delegate] window];
[keywindow addSubview:pop_v];
//[keywindow bringSubviewToFront:pop_v];
//[self.view addSubview:pop_v];
}
I have tried use [keywindow bringSubviewToFront:pop_v]
to bring to front.But do not work.
And if I use [self.view addSubview:pop_v]
, it shows in the front.