Xamarin Forms-错误MT2002:无法解析UIKit.UIEdgeInsets [英] Xamarin Forms - Error MT2002: Failed to resolve UIKit.UIEdgeInsets

查看:83
本文介绍了Xamarin Forms-错误MT2002:无法解析UIKit.UIEdgeInsets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理Xamarin.Forms项目,并且在将Xamarin.Forms版本更新为2.4.0.74863之后遇到以下错误.

I am working on a Xamarin.Forms project and I am getting the following error after I updated my Xamarin.Forms version to 2.4.0.74863.

/Users/UserName/Official/Projects/ProjectFolder/ProjectName/iOS/MTOUCH: Error MT2002: Failed to resolve "UIKit.UIEdgeInsets UIKit.UIView::get_SafeAreaInsets()" reference from "Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065" (MT2002) (ProjectName.iOS)

我该如何解决? 我的计算机中已安装 XCode 8.2.1 Xamarin Studio 6.1.2.44 .

How can I resolve this? I have XCode 8.2.1, Xamarin Studio 6.1.2.44 installed in my machine.

我试图将链接模式更改为不链接"(虽然不是首选),但它带来了不同的问题.

I tried to change the link mode to 'Don't Link' (although its not preferable) but it gives different problems.

推荐答案

除了更新Xcode (to 9.x)之外,还必须在Info.plist文件中将Deployment Target设置为iOS 9.0.

Besides updating Xcode (to 9.x) you must set the Deployment Target to iOS 9.0 in the Info.plist file.

这是因为SafeAreaInsets仅在iOS 9及更高版本中可用(如注释中指出的 SushiHangover ) .

This is because SafeAreaInsets is only available in iOS 9 and up (as SushiHangover pointed out in the comments).

但是,这意味着您的应用只能在运行iOS 9.0及更高版本的设备上运行.

这篇关于Xamarin Forms-错误MT2002:无法解析UIKit.UIEdgeInsets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆