iOS present至全屏透明viewcontroller(登

2017-12-08  本文已影响0人  宝山潇洒哥

UIView *v = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 300, 300)];

v.backgroundColor = [UIColor redColor];

PopUpViewController *pvc = [[PopUpViewController alloc]initWithView:v needAnimate:YES];

[UIApplication displayViewController].definesPresentationContext = YES; //self is presenting view controller

UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:pvc];

nav.modalPresentationStyle = UIModalPresentationOverCurrentContext&UIModalPresentationOverFullScreen;

[[UIApplication displayViewController] presentViewController:nav animated:NO completion:^{}];

上一篇 下一篇

猜你喜欢

热点阅读