ios - 支持的方向与应用程序没有共同的方向,shouldAutorotate 在 xamarin iOS 中返回 YES'

标签 ios xamarin

我的应用程序仅支持横向模式。当我尝试在应用程序中打开图像选择器时,它显示一个异常,如下所示: “支持的方向与应用程序没有共同的方向,shouldAutorotate 返回 YES” 我曾尝试为 shouldAutorotate 设置错误值,但没有成功。我被这个问题困住了。有人对此有任何帮助吗?

最佳答案

如果你喜欢使用 UIImagePickerController 作为 lanndscape 模式,而不是

- (BOOL)shouldAutorotate
{
 return NO;
}

用这个

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}

但请务必将其检查为:

enter image description here

关于ios - 支持的方向与应用程序没有共同的方向,shouldAutorotate 在 xamarin iOS 中返回 YES',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29250294/

相关文章:

ios - 如何使用 AFNetwork 的 AFHTTPRequestOperationManager 设置 HTTP 请求体?

iphone - 使用 GData Obj-C 设置 YouTube 视频的隐私

ios - NSDateFormatter 缺少方法...我是否缺少导入

ios - 如何在 Xcode 中创建 Entitlement.plist 文件?

ios - 如何在 Facebook 登录中访问 user_location?

c# - 图像被分配给 ListView 的另一个行项目

c# - 如何在 Xamarin android 中更改操作栏标题颜色

xamarin - 什么时候会使用非通用版本的 MvxAppCompatSetup<T>?

c# - MonoTouch 6.0.8 发行说明中的​​ "Runtime Trampolines"是什么意思?

listview - Xamarin.Forms ListView 禁用 UWP 上的选择