美文网首页iOS技术开发
ios 模态推出全屏

ios 模态推出全屏

作者: 前端大神121212 | 来源:发表于2018-07-19 09:51 被阅读44次
    SearchVC * vc = [[SearchVC alloc] init];
    
    // 底部向上  UIModalTransitionStyleCoverVertical
     // 淡入     UIModalTransitionStyleCrossDissolve
     // 翻转     UIModalTransitionStyleFlipHorizontal
     // 翻半页   UIModalTransitionStylePartialCurl
    vc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
    
    
    /* UIModalPresentationFullScreen代表弹出VC时,presented VC充满全屏,如果弹出VC的wantsFullScreenLayout设置为YES的,则会填充到状态栏下边,否则不会填充到状态栏之下。
       UIModalPresentationPageSheet代表弹出是弹出VC时,presented VC的高度和当前屏幕高度相同,宽度和竖屏模式下屏幕宽度相同,剩余未覆盖区域将会变暗并阻止用户点击,这种弹出模式下,竖屏时跟UIModalPresentationFullScreen的效果一样,横屏时候两边则会留下变暗的区域。
       UIModalPresentationFormSheet这种模式下,presented VC的高度和宽度均会小于屏幕尺寸,presented VC居中显示,四周留下变暗区域。
       UIModalPresentationCurrentContext这种模式下,presented VC的弹出方式和presenting VC的父VC的方式相同。
       这四种方式在iPad上面统统有效,但在iPhone和iPod touch上面系统始终已UIModalPresentationFullScreen模式显示presented VC。
       */
    vc.modalPresentationStyle= UIModalPresentationFullScreen;
    
    // ios 7  弃用  vc.wantsFullScreenLayout
    [self presentViewController:vc animated:NO completion:NULL];
    

    相关文章

      网友评论

        本文标题:ios 模态推出全屏

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