UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

后端 未结 12 1463
我寻月下人不归
我寻月下人不归 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:13

    I got the same issue. I tested on both iOS 7.1.2 and iOS 8. So far, it only happened on iPad device with iOS 8. So I temporarily fix it by following code:

    // In my app, I subclass UIImagePickerController and code my own control buttons
    // showsCameraControls = NO;
    - (void)viewWillAppear:(BOOL)animated
    {
      [super viewWillAppear:animated];
      [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIInterfaceOrientationPortrait] forKey:@"orientation"];
    }
    

    It is not recommended because it will mess up the presentingViewController's orientation.

    Are there any replies from Apple yet?

提交回复
热议问题