Force landscape orientation in UIImagePickerController

前端 未结 3 1074
耶瑟儿~
耶瑟儿~ 2020-11-27 21:11

I\'m new to iOS development, and Im developing my first app. (so sorry if Im asking a newbie question)

My app is all in portrait orientation, except to the place whe

3条回答
  •  死守一世寂寞
    2020-11-27 21:32

    try implementing below methods:

    - (BOOL)shouldAutorotate
    {
    
    return YES;
    }
    
    -(NSUInteger)supportedInterfaceOrientations
    
    {
    return UIInterfaceOrientationMaskLandscape;
    
    }
    
    - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
    {
      return UIInterfaceOrientationLandscapeRight;
    }
    

提交回复
热议问题