如何在iOS 8中呈现半透明(半切)视图控制器 [英] How to present a semi-transparent (half-cut) viewcontroller in iOS 8
本文介绍了如何在iOS 8中呈现半透明(半切)视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在iOS 7中,此方法没有问题:
in iOS 7 there is no problem for this method:
_rootViewController.modalPresentationStyle = UIModalPresentationCurrentContext;
[_rootViewController presentViewController:self animated:NO completion:nil];
但在iOS 8中它没有做任何事情。如何解决?这是iOS 8的Bug吗?
But in iOS 8 it did nothing.How to solve it? Is it a Bug for iOS 8?
推荐答案
我的答案更简单,代码如下。这适用于iOS8(XCode6 GM种子)。
My answer is more simple, below code. This works in iOS8 (XCode6 GM seed).
HogeViewController *vc = [[HogeViewController alloc] init];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self presentViewController:vc animated:NO completion:nil];
这篇关于如何在iOS 8中呈现半透明(半切)视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文