ios - Xamarin.Forms iOS UIKit.UIImage 错误

标签 ios forms xamarin uikit xamarin.forms

我一直在使用 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");
        }
    }
}

最佳答案

所以事实证明,错误是由于试图为选项卡式 View 提供图标而引起的。这在 android 上运行良好,但显然在 ios 上不受支持,所以要修复错误,我只需要注释掉设置选项卡式 View 的图标的行。

关于ios - Xamarin.Forms iOS UIKit.UIImage 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33619308/

相关文章:

xamarin - 找不到路径 'AccessibilityManagerCompat_AccessibilityStateChangeListenerImplementor.class' 的一部分

ios - "Xcode cannot run using the selected device"

ios - 如何在IOS中绘制UITextView的边框

php - 如何防止用户为网址添加书签?

javascript - 如何防止谷歌浏览器缓存我的输入,尤其是当用户点击返回时隐藏的输入?

c# - Xamarin 安卓 : Cannot use ActionBarActivity

ios - 如何在 iOS 11+ 中以编程方式打开“设置”>“隐私”>“位置服务”?

ios - 如何检测用户何时从应用程序中截取屏幕截图?

java - <s :select> use map as list excluding given keys

ios - OpenGL ES 2.0 - 绘制线条(绘图)中的内存管理