TabbarController上面弹窗导致被tabbar遮挡问

2020-10-09  本文已影响0人  BlueBar

在使用控制器做弹窗时,当需要在当前控制器页面上弹窗,而控制器在TabbarController首页时,弹窗的底部会被tabbar遮挡,这是就需要把弹窗加到window上显示.

UIViewController *vc = [[UIViewController alloc]init];
vc.providesPresentationContextTransitionStyle = YES;
vc.definesPresentationContext = YES;
[vc setModalPresentationStyle:UIModalPresentationOverCurrentContext];
AppDelegate *appdelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
appdelegate.window.rootViewController.definesPresentationContext = YES;
[appdelegate.window.rootViewController presentViewController:vc  animated:NO completion:nil];
上一篇 下一篇

猜你喜欢

热点阅读