Skip to content

Commit acd6ef5

Browse files
committed
Fixed the small bug of CameraViewController, for rotation.
1 parent a29f8c7 commit acd6ef5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CameraViewController.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ - (void)viewWillAppear:(BOOL)animated {
248248

249249
[self adjustCameraPreviewLayerOrientaion:self.interfaceOrientation];
250250

251-
canRotate = YES;
251+
canRotate = NO;
252252
}
253253

254254
- (void)viewWillDisappear:(BOOL)animated {
@@ -266,7 +266,9 @@ - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrie
266266
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
267267
// I can't understand the orienation behavior of view controllers.....
268268
// Recommend that you don't overide this method... or please help me.
269-
return canRotate;
269+
if (canRotate)
270+
return YES;
271+
return (interfaceOrientation == UIInterfaceOrientationPortrait);
270272
}
271273

272274
#pragma mark - AVCaptureVideoDataOutputSampleBufferDelegate

0 commit comments

Comments
 (0)