[英]UIKIt.UIImage does not contain a defintion for Save and no extension method save of type UIKit.UIImage not found.Are you mIssing assembly reference?
[英]Xamarin.Forms iOS UIKit.UIImage Error
我一直在使用Xamarin.Forms制作移動應用程序。 我有一切都在Android上工作,但當我嘗試在iOS上啟動時,我收到錯誤:
System.Exception: Could not initialize an instance of the type 'UIKit.UIImage': the native 'initWithContentsOfFile:' method returned nil.
>It is possible to ignore this condition by setting MonoTouch.ObjCRuntime.Class.ThrowOnInitFailure to false.
....
有誰知道如何解決這個問題?
編輯:這是它給我錯誤的代碼,但我感覺還有別的東西導致它:
using System;
using System.Collections.Generic;
using System.Linq;
using Foundation;
using UIKit;
namespace CloudClubv1._2_.iOS
{
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
}
}
事實證明,錯誤是由於嘗試為標簽視圖提供圖標而引起的。 這在android上工作正常,但顯然在ios上它不受支持,所以要修復錯誤我只需要注釋掉設置選項卡視圖的圖標的行。
確保在IOS項目中,將Resources / image屬性設置為BundledResources。 在我的項目中,他們被設置為AndroidResources,當我糾正到BundledResources時,我開始工作正常。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.