UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

后端 未结 12 1495
我寻月下人不归
我寻月下人不归 2020-12-07 16:34

I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo)

12条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 17:28

    Cannot wait for Apple to fix the issue...

    - (void)viewWillAppear:(BOOL)animated
    {
      ...
      if (iPad & iOS 8)
      {
        switch (device_orientation)
        {
          case UIDeviceOrientationPortraitUpsideDown: self.cameraViewTransform = CGAffineTransformMakeRotation(DEGREES_RADIANS(180)); break;
          case UIDeviceOrientationLandscapeLeft: self.cameraViewTransform = CGAffineTransformMakeRotation(DEGREES_RADIANS(90)); break;
          case UIDeviceOrientationLandscapeRight: self.cameraViewTransform = CGAffineTransformMakeRotation(DEGREES_RADIANS(-90)); break;
          default: break;
        }
      }
    }
    

提交回复
热议问题