DevCali
DevCali

Reputation: 398

UIView on top of iPhone screen

In my app, i need a transparent view to work as an alert view that can cover the entire screen of iPhone including navigation bar and tab bar, i know how to make a transparent view however, i need help in presenting this transparent view to cover the entire screen and should be on top of navigation and tab bar.

I tried this code but as expected, it only cover the view bounds. not the navigation or tabbar.

- (IBAction)joinBtnTapped:(UIBarButtonItem *)sender
{
    UIView *blackTransparentView = [[UIView alloc]initWithFrame:self.view.bounds];
    [blackTransparentView setBackgroundColor:[UIColor blackColor]];
    [blackTransparentView setAlpha:50.0];

    [self.view addSubview:blackTransparentView];   
}

Upvotes: 0

Views: 143

Answers (1)

adali
adali

Reputation: 5977

[[UIApplication sharedApplication].delegate.window addSubview:....];

Upvotes: 2

Related Questions