当前位置: 代码迷 >> 综合 >> present 一个透明的viewController
  详细解决方案

present 一个透明的viewController

热度:2   发布时间:2023-12-09 12:25:48.0

PieChartViewController *pieChartVC = [[PieChartViewController alloc] init];

        pieChartVC.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;;

        

        //根视图操作,实现present一个透明Controller

//注意要在根视图上进行操作

//modalPresentationStyle 设置为 UIModalPresentationCurrentContext

        UIViewController* controller = self.view.window.rootViewController;

        controller.modalPresentationStyle = UIModalPresentationCurrentContext;

        [controller presentViewController:pieChartVC animated:YES completion:nil];