美文网首页
iOS present至全屏透明viewcontroller(登

iOS present至全屏透明viewcontroller(登

作者: 宝山潇洒哥 | 来源:发表于2017-12-08 12:55 被阅读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:^{}];

相关文章

网友评论

      本文标题:iOS present至全屏透明viewcontroller(登

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