美文网首页
TabbarController上面弹窗导致被tabbar遮挡问

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

作者: BlueBar | 来源:发表于2020-10-09 15:39 被阅读0次

在使用控制器做弹窗时,当需要在当前控制器页面上弹窗,而控制器在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];

相关文章

网友评论

      本文标题:TabbarController上面弹窗导致被tabbar遮挡问

      本文链接:https://www.haomeiwen.com/subject/pyvlpktx.html