简体   繁体   English

UIView在iPhone屏幕上方

[英]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. 在我的应用程序中,我需要一个透明的视图作为一个警报视图,可以覆盖iPhone的整个屏幕,包括导航栏和标签栏,我知道如何制作一个透明的视图,但我需要帮助提出这个透明的视图来覆盖整个屏幕应该在导航和标签栏的顶部。

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];   
}
[[UIApplication sharedApplication].delegate.window addSubview:....];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM