|
|
@@ -35,81 +35,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
--(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
-{
|
|
|
-// UIApplication * app = [UIApplication sharedApplication];
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
-// [appDelegate didRotated];
|
|
|
-
|
|
|
- // [CATransaction begin];
|
|
|
- // [CATransaction setAnimationDuration:0.5];
|
|
|
- // [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
|
|
|
- // // [self updatePreviewLayerForOrientation:toInterfaceOrientation];
|
|
|
- // _previewLayer.position = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
|
|
|
- //
|
|
|
- // // self.backgroundView.highLightRect = CGRectInset(self.focusZone.frame,6,6);
|
|
|
- // _previewLayer.bounds = rect;
|
|
|
- //
|
|
|
- // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
- // switch (orientation) {
|
|
|
- //
|
|
|
- //
|
|
|
- //
|
|
|
- // case UIInterfaceOrientationPortrait:
|
|
|
- // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(0)];
|
|
|
- //
|
|
|
- // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationPortrait;
|
|
|
- // break;
|
|
|
- // case UIInterfaceOrientationPortraitUpsideDown:
|
|
|
- // //[_previewLayer setAffineTransform:CGAffineTransformMakeRotation(M_PI)];
|
|
|
- // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationPortraitUpsideDown;
|
|
|
- // break;
|
|
|
- // case UIInterfaceOrientationLandscapeLeft:
|
|
|
- // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(M_PI/2)];
|
|
|
- // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationLandscapeLeft;
|
|
|
- // break;
|
|
|
- // case UIInterfaceOrientationLandscapeRight:
|
|
|
- // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(-M_PI/2)];
|
|
|
- // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationLandscapeRight;
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // [CATransaction commit];
|
|
|
-
|
|
|
- // 2018.12.28 iPad Pro 11-inch位置不正确
|
|
|
-// NSTimeInterval animationDuration = 0.30f;
|
|
|
-// [UIView beginAnimations:nil context:nil];
|
|
|
-// [UIView setAnimationDuration:animationDuration];
|
|
|
-//
|
|
|
-// UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
-// if (UIInterfaceOrientationIsLandscape(orientation))
|
|
|
-// {
|
|
|
-//
|
|
|
-//
|
|
|
-// self.buttonAlbum.frame = CGRectMake(942,120,48,48);
|
|
|
-// self.buttonCamera.frame = CGRectMake(942,200,48,48);
|
|
|
-// self.buttonUpload.frame = CGRectMake(942,363,48,48);
|
|
|
-// // @property (strong, nonatomic) IBOutlet UIButton *buttonAlbum;
|
|
|
-// // @property (strong, nonatomic) IBOutlet UIButton *buttonCamera;
|
|
|
-// // @property (strong, nonatomic) IBOutlet UIButton *buttonUpload;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// self.buttonAlbum.frame = CGRectMake(82,918,48,48);
|
|
|
-// self.buttonCamera.frame = CGRectMake(173,918,48,48);
|
|
|
-// self.buttonUpload.frame = CGRectMake(635,918,48,48);
|
|
|
-//
|
|
|
-// }
|
|
|
-//
|
|
|
-// [UIView commitAnimations];
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
+//-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
+//{
|
|
|
+//// UIApplication * app = [UIApplication sharedApplication];
|
|
|
+//// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
+//// [appDelegate didRotated];
|
|
|
+//
|
|
|
+// // [CATransaction begin];
|
|
|
+// // [CATransaction setAnimationDuration:0.5];
|
|
|
+// // [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
|
|
|
+// // // [self updatePreviewLayerForOrientation:toInterfaceOrientation];
|
|
|
+// // _previewLayer.position = CGPointMake(CGRectGetMidX(rect), CGRectGetMidY(rect));
|
|
|
+// //
|
|
|
+// // // self.backgroundView.highLightRect = CGRectInset(self.focusZone.frame,6,6);
|
|
|
+// // _previewLayer.bounds = rect;
|
|
|
+// //
|
|
|
+// // UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
+// // switch (orientation) {
|
|
|
+// //
|
|
|
+// //
|
|
|
+// //
|
|
|
+// // case UIInterfaceOrientationPortrait:
|
|
|
+// // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(0)];
|
|
|
+// //
|
|
|
+// // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationPortrait;
|
|
|
+// // break;
|
|
|
+// // case UIInterfaceOrientationPortraitUpsideDown:
|
|
|
+// // //[_previewLayer setAffineTransform:CGAffineTransformMakeRotation(M_PI)];
|
|
|
+// // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationPortraitUpsideDown;
|
|
|
+// // break;
|
|
|
+// // case UIInterfaceOrientationLandscapeLeft:
|
|
|
+// // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(M_PI/2)];
|
|
|
+// // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationLandscapeLeft;
|
|
|
+// // break;
|
|
|
+// // case UIInterfaceOrientationLandscapeRight:
|
|
|
+// // // [_previewLayer setAffineTransform:CGAffineTransformMakeRotation(-M_PI/2)];
|
|
|
+// // _previewLayer.connection.videoOrientation=AVCaptureVideoOrientationLandscapeRight;
|
|
|
+// // break;
|
|
|
+// // default:
|
|
|
+// // break;
|
|
|
+// // }
|
|
|
+// // [CATransaction commit];
|
|
|
+//
|
|
|
+// // 2018.12.28 iPad Pro 11-inch位置不正确
|
|
|
+//// NSTimeInterval animationDuration = 0.30f;
|
|
|
+//// [UIView beginAnimations:nil context:nil];
|
|
|
+//// [UIView setAnimationDuration:animationDuration];
|
|
|
+////
|
|
|
+//// UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
+//// if (UIInterfaceOrientationIsLandscape(orientation))
|
|
|
+//// {
|
|
|
+////
|
|
|
+////
|
|
|
+//// self.buttonAlbum.frame = CGRectMake(942,120,48,48);
|
|
|
+//// self.buttonCamera.frame = CGRectMake(942,200,48,48);
|
|
|
+//// self.buttonUpload.frame = CGRectMake(942,363,48,48);
|
|
|
+//// // @property (strong, nonatomic) IBOutlet UIButton *buttonAlbum;
|
|
|
+//// // @property (strong, nonatomic) IBOutlet UIButton *buttonCamera;
|
|
|
+//// // @property (strong, nonatomic) IBOutlet UIButton *buttonUpload;
|
|
|
+//// }
|
|
|
+//// else
|
|
|
+//// {
|
|
|
+//// self.buttonAlbum.frame = CGRectMake(82,918,48,48);
|
|
|
+//// self.buttonCamera.frame = CGRectMake(173,918,48,48);
|
|
|
+//// self.buttonUpload.frame = CGRectMake(635,918,48,48);
|
|
|
+////
|
|
|
+//// }
|
|
|
+////
|
|
|
+//// [UIView commitAnimations];
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//
|
|
|
+//}
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|