Why are my Xamarin UWP Images not showing up on device?

前端 未结 4 1188
忘掉有多难
忘掉有多难 2021-01-27 10:32

I am developing a Xamarin UWP app using ffimageloading. The images show up just fine on the Windows Phone emulator that I am running through Visual Studio, but when I deploy it

4条回答
  •  一生所求
    2021-01-27 11:14

    To get "Compile with .NET Native tool chain" working you have to use UWP-specific overload of the Forms.Init call which allows to correctly include FFImageLoading assemblies for Xamarin.Forms usage:

    // you'll need to add `using System.Reflection;`
    List assembliesToInclude = new List();
    
    //Now, add in all the assemblies your app uses
    assembliesToInclude.Add(typeof (FFImageLoadingAssembliesHere).GetTypeInfo().Assembly);
    
    //Also do this for all your other 3rd party libraries
    
    Xamarin.Forms.Forms.Init(e, assembliesToInclude);
    // replaces Xamarin.Forms.Forms.Init(e);
    

提交回复
热议问题