We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to resolve SfListView not rendering issue in iOS, macOS and UWP in Xamarin Forms

Platform: Xamarin.Forms |
Control: SfListView |
Published Date: March 26, 2020 |
Last Revised Date: March 26, 2020

Xamarin does not load the renderer assemblies, by default, in iOS and UWP projects. Hence, to solve this, you need to manually load it by calling the Init method of SfListViewRenderer class in the respective projects as mentioned below.

iOS Project

Call the SfListViewRenderer.Init() in the FinishedLaunching overridden method of the AppDelegate class after the Xamarin.Forms Framework initialization, and before the LoadApplication is called as demonstrated in the following code example:

using Syncfusion.XForms.iOS.EffectsView;
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
    …
    global::Xamarin.Forms.Forms.Init();
    SfListViewRenderer.Init();
    SfEffectsViewRenderer.Init();  //Initialize only when effects view is added to Listview.
    LoadApplication(new App());
    …
}

 

Note:

When EffectsView is applied to ListView by adding Visual as "Material", it is necessary to initialize EffectsViewRenderer in iOS.

 

UWP Project

Call the SfListViewRenderer.Init() in the MainPage constructor before the LoadApplication is called as demonstrated in the following code example:

public MainPage()
{
    …
    SfListViewRenderer.Init();
    LoadApplication(new App());
    …
}

 

macOS Project

Call the SfListViewRenderer.Init() in the DidFinishLaunching override method of the AppDelegate class after calling the Xamarin.Forms Framework and LoadApplication initialization.:

public override void DidFinishLaunching(NSNotification notification)
{
    Forms.Init();
    LoadApplication(new App());
    SfListViewRenderer.Init();
    …
}

 

ReleaseMode Issue in UWP Platform

The known Framework issue in UWP platform is the custom controls will not render when deployed the application in Release Mode.

The above problem can be resolved by initializing the ListView assemblies in App.xaml.cs in UWP project as in the following code snippet:

// In App.xaml.cs
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    …
    rootFrame.NavigationFailed += OnNavigationFailed;
    // you'll need to add ‘using System.Reflection;’
    List<Assembly> assembliesToInclude = new List<Assembly>();
    //Now, add all the assemblies your app uses
    assembliesToInclude.Add(typeof(SfListViewRenderer).GetTypeInfo().Assembly);
    // replaces Xamarin.Forms.Forms.Init(e);        
    Xamarin.Forms.Forms.Init(e, assembliesToInclude);
    …     
}

 

2X faster development

The ultimate Xamarin UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment
Comments
Amir H
Apr 11, 2021

This does not seem to work any more and as a result, SfListView and other SF controls such as Calendar, etc. are not being renderer in Release mode on UWP.

Reply
Lakshmi Natarajan [Syncfusion]
Apr 19, 2021

Hi Amir,

Greetings from Syncfusion.

We have checked the reported query “SfListView and Calendar are not being renderer in Release mode on UWP” from our side. We would like to inform you that we could not reproduce the reported issue at our side. We have attached the tested sample in the following link,

Sample

Please check our sample and let us know if you still facing the same issue? If not, please modify our sample and revert us back which would be helpful for us to check on it and provide you the solution at the earliest.

Regards, Lakshmi Natarajan

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile