Overlay a view over whole screen, when using UITabBarController?

后端 未结 5 638
渐次进展
渐次进展 2021-02-08 02:13

I want to overlay a HUD-style transparent graphic over the entire screen in a UITabBarController setup. The button to do this is in the first tab\'s screen (FirstViewController)

5条回答
  •  野的像风
    2021-02-08 02:55

    UIView *modal = [[UIView alloc] initWithFrame:self.view.window.frame];
    [self.view.window addSubview:modal];
    

    This might be the same as the [[UIApplication sharedApplication] keyWindow] mentioned above. But I like referencing it through the current view.

提交回复
热议问题