iOS CAlayer Orientation AVCaptureVideoPreviewLayer doesn't rotate

后端 未结 8 767
既然无缘
既然无缘 2020-12-24 09:50

\"enter Summary: I can\'t force the CALayer to respond correctly to orientati

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-24 10:38

    I'm with @Siegfault, although I also found that when my view loads in landscape orientation on the iPad initially, the orientation is still in correct. To fix, I call that same delegate method in viewDidAppear: with the current interfaceOrientation:

    - (void)viewDidAppear:(BOOL)animated {
        [super viewDidAppear:animated];
        [self willRotateToInterfaceOrientation:self.interfaceOrientation duration:0.0];
    }
    

提交回复
热议问题