Using UIImagePickerController in landscape orientation

后端 未结 8 701
暗喜
暗喜 2020-11-28 09:55

I am creating an app which is in landscape mode and I am using UIImagePickerController to take photos using iPhone camera in it and I want to create it in lands

8条回答
  •  盖世英雄少女心
    2020-11-28 10:25

    If you'd like to use UIImagePickerController in landscape mode, use user1673099's answer, but instead of:

    - (BOOL)shouldAutorotate
    {
        return NO;
    }
    

    use:

    - (UIInterfaceOrientationMask)supportedInterfaceOrientations{
        return UIInterfaceOrientationMaskLandscape;
    }
    

    and then the picker would open in landscape mode:

    enter image description here

    But make sure you check Portrait in deployment info:

    enter image description here

提交回复
热议问题