对于针对iOS 7和iOS 8的应用,我使用了两个具有以下特征的ViewControllers:
我已经提到IOS 7: Transparent Viewcontroller Background over another Viewcontroller with different Orientation behaviour,但提供的解决方案不起作用。在iOS 8上,我可以获得VC2的横向或透明度,但不能同时获得
这就是我正在做的事情:
self.view.backgroundColor = [UIColor clearColor];
UILabel* label = [[UILabel alloc] initWithFrame:self.view.frame];
label.text = @" I'M VC1";
[self.view addSubview:label];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
LandscapeViewController* lvc = [[LandscapeViewController alloc] init];
self.modalPresentationStyle = UIModalPresentationOverCurrentContext;
//Uncomment this line for transparency but loses orientation
//lvc.modalPresentationStyle = UIModalPresentationOverCurrentContext;
[self presentViewController:lvc animated:YES completion:nil];
});
知道什么是错的,我怎么能让它运作?