Crash on presenting UIImagePickerController under iOS 6.0

前端 未结 5 1770
陌清茗
陌清茗 2020-11-28 04:21

My app only supports landscape orientations via the supportedInterfaceOrientation properties.

Using an iOS prior to iOS 6, my app can successfully load

5条回答
  •  悲&欢浪女
    2020-11-28 04:48

    While subclassing UIImagePickerController works, a category is a better solution:

        @implementation UIImagePickerController (NonRotating)
    
        - (BOOL)shouldAutorotate
        {
            return NO;
        }
    
        -(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
        {
            return UIInterfaceOrientationPortrait;
        }
    
        @end
    

提交回复
热议问题