半透明Viewcontroller在另一个具有不同Orientation行为的Viewcontroller上

AJ.*_*AJ. 5 transparency objective-c orientation ios7 ios8

对于针对iOS 7和iOS 8的应用程序,我使用两个ViewControllers,它应具有以下特征:

  • ViewController 1(VC1)处于纵向模式
  • VC1创建了ViewController 2(VC2),处于横向模式
  • VC2具有半透明背景,因此VC1的内容是可见的

我已经提到了IOS 7:透明Viewcontroller背景,而不是另一个具有不同Orientation行为的Viewcontroller,但提供的解决方案不起作用.在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];

});
Run Code Online (Sandbox Code Playgroud)

知道什么是错的,我怎么能让它运作?