SfListView only working correctly on Android

Hello,

I have run into a problem using the SfListView control. On Android it seems to work fine, but on IOS it does not display anything unless i add enough items to overfill the view and require the user to scroll down. (screenshots will be included aswell as code)

Screenshots:

Android(Without adding extra list items)


Android(After adding extra items)


Apple(WithoutAddingExtras)

Apple(After adding extras)

NotificationPage(XAML)

    


x:Name="ECommerceNotifications"
AllowSwiping="True"
IsScrollBarVisible="False"
Margin="0,10,0,10"
SelectionBackgroundColor="Transparent"
SelectionGesture="Tap"
SelectionMode="Single"
TapCommand="{Binding ItemTappedCommand}"
VerticalOptions="StartAndExpand"
AutoFitMode="Height"
ItemsSource="{Binding NotificationList}"
Loaded="ECommerceNotifications_Loaded">





Margin="0,10,0,10"
ColumnDefinitions="Auto, *"
ColumnSpacing="0"
RowSpacing="0"
Padding="10"
HeightRequest="100"
BackgroundColor="{DynamicResource Gray-100}">
















Grid.Row="0"
Grid.Column="1"
Margin="0,8,0,4"
FontFamily="Montserrat-SemiBold"
FontSize="14"
HorizontalOptions="StartAndExpand"
LineBreakMode="TailTruncation"
LineHeight="1.5"
MaxLines="1"
Text="Subject"
TextColor="{DynamicResource Gray-900}" />



Grid.Row="1"
Grid.Column="1"
Margin="0,0,0,8"
FontFamily="Montserrat-Medium"
FontSize="12"
HorizontalOptions="StartAndExpand"
LineHeight="1.5"
Text="{Binding Notification}"
TextColor="{DynamicResource Gray-700}" />


Grid.Row="3"
Grid.Column="1"
Margin="0,4,0,0"
Padding="0"
HorizontalOptions="Start"
Orientation="Horizontal"
Spacing="0"
VerticalOptions="Start">



Margin="0"
FontFamily="Montserrat-Medium"
FontSize="12"
Text="{Binding RequestId}"
TextColor="{StaticResource Gray-400}"
VerticalOptions="Center" />














NotificationPage(XAML.CS)

<object>

<object>

<object>

<object>

<object>

public partial class NotificationPage

{

public ECommerceNotificationViewModel ViewModel;

///

/// Initializes a new instance of the class.

///

public NotificationPage()

{

this.InitializeComponent();

this.BindingContext = ViewModel = new ECommerceNotificationViewModel();

OnAppearing();

}

async protected override void OnAppearing()

{

base.OnAppearing();

await ViewModel.LoadNotificationsTask();

}

private void SfButton_Clicked(object sender, System.EventArgs e)

{

ObservableCollection oldSource = (ObservableCollection)ECommerceNotifications.ItemsSource;

oldSource.Add(new OCNotifications() { Notification = "new", Subject = "new", RequestId = oldSource.Count + 1 });

ECommerceNotifications.ItemsSource = oldSource;

}

private void ECommerceNotifications_Loaded(object sender, Syncfusion.ListView.XForms.ListViewLoadedEventArgs e)

{

// try reload here

int count = (int)ViewModel.NotificationList.Count;

if (count >= 1)

{

ECommerceNotifications.RefreshView();

}}}

<object>

Notes: I did base the notification page originally off the UIKIT notification page but altered it a bit after testing on IOS but the results are the same here as i was getting on the original page (with the different viewmodel)



Thanks!


-Michael








3 Replies

SY Suthi Yuvaraj Syncfusion Team September 1, 2022 02:19 PM UTC

Hi Michael, 

 

We have checked the reported issue at our end, we are unable to replicate the reported scenario on our end with the provided code snippet. We have prepared a simple sample with provided code snippet and attached the sample with output screenshot for your reference. Please have a look at this sample and let us know if missed any customization you have done in your application or revert us with the modified sample or full XAML and C# code snippets related to SfListView to replicate the reported issue on our end. 

 

We would like to know that you have initialized the renderer for iOS project, please refer the below documentation related to it. If possible can we arrange a meeting to investigate the problem at your end?

 

UG Link: https://help.syncfusion.com/xamarin/listview/getting-started#ios

 

 

Regards, 

Suthi Yuvaraj.


Attachment: GettingStarted_5a3e741f.zip


MS Michael Sansom replied to Suthi Yuvaraj September 6, 2022 02:42 AM UTC

Hello!


I have added your code to the project and it worked fine, however when swapping the data source back to the notifications loaded from a server it has reverted to how it was working before.



SY Suthi Yuvaraj Syncfusion Team September 6, 2022 02:09 PM UTC

Hi Michael,


We have tried to reproduce the issue by updating datasource for server with latest version of our ListView control(version-20.2.0.46) and Xamarin.Forms(version- 5.0.0.2125).We are unable to reproduce the issue at our end . Please share the below details, which will help us to give the appropriate solution as soon as possible.

1.Data population related code snippet

2.Syncfusion nuget version and Xamarin.Forms version

3.Tested device details.


Regards,

Suthi Yuvaraj


Loader.
Up arrow icon