Skip to content

Commit

Permalink
Fixed the small bug of CameraViewController, for rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
sonsongithub committed Sep 22, 2011
1 parent a29f8c7 commit acd6ef5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CameraViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ - (void)viewWillAppear:(BOOL)animated {

[self adjustCameraPreviewLayerOrientaion:self.interfaceOrientation];

canRotate = YES;
canRotate = NO;
}

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

#pragma mark - AVCaptureVideoDataOutputSampleBufferDelegate
Expand Down

0 comments on commit acd6ef5

Please sign in to comment.