Hi Dinesh,
- Share the view loaded in the swipe template and item template properties?
Swipe Template:
<DataTemplate x:Name="RightSwipeTemplate">
<Grid ColumnSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<StackLayout BackgroundColor="#F9E1B8" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="0">
<Image HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" BackgroundColor="Transparent" Source="{StaticResource ImgCall}" HeightRequest="25" WidthRequest="25" BindingContextChanged="callImageContextChanged" />
</StackLayout>
<StackLayout BackgroundColor="#C36418" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="1">
<Image HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" BackgroundColor="Transparent" Source="{StaticResource ImgCalender}" HeightRequest="25" WidthRequest="25" BindingContextChanged="calenderImageContextChanged" />
</StackLayout>
<StackLayout BackgroundColor="#D31145" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Column="2">
<Image HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand" BackgroundColor="Transparent" Source="{StaticResource ImgDelete}" HeightRequest="25" WidthRequest="25" BindingContextChanged="deleteImageContextChanged" />
</StackLayout>
</Grid>
Item Template:
listView.ItemTemplate = new DataTemplate(() =>
{
var grid = new Grid();
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
grid.BackgroundColor = Color.White;
grid.RowSpacing = 0;
var card = new StackLayout
{
BackgroundColor = Color.White,
Margin = new Thickness(0, 14, 0, 0),
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Horizontal,
};
var icon = new Image
{
HorizontalOptions = LayoutOptions.Start,
HeightRequest = 40,
WidthRequest = 40,
Margin = new Thickness(10, 5, 5, 5),
VerticalOptions = LayoutOptions.Center,
Aspect = Aspect.AspectFit,
Source = msDeviceSetting.Image,
};
var description = new Label
{
FontFamily = Fonts.DIN,
HorizontalOptions = LayoutOptions.FillAndExpand,
//VerticalOptions = LayoutOptions.FillAndExpand,
HeightRequest = 50,
FontSize = Device.GetNamedSize(NamedSize.Default, typeof(Label)),
Margin = new Thickness(5, 0, 5, 0),
};
description.SetBinding(Label.TextProperty, "message");
description.SetBinding(Label.FontAttributesProperty, "isRead", converter: new FontAttributesConverter());
var time = new Label
{
FontFamily = Fonts.DIN,
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.Start,
Margin = new Thickness(5, 0, 5, 3),
FontSize = Device.GetNamedSize(NamedSize.Micro, typeof(Label)),
};
time.SetBinding(Label.TextProperty, "timestamp_formatted");
var line = new StackLayout
{
BackgroundColor = Color.Black,
HeightRequest = 0.5,
Margin = new Thickness(5, 0, 0, 0),
HorizontalOptions = LayoutOptions.FillAndExpand,
};
var contentLayout = new StackLayout
{
HorizontalOptions = LayoutOptions.FillAndExpand,
Orientation = StackOrientation.Vertical,
VerticalOptions = LayoutOptions.FillAndExpand,
BackgroundColor = Color.White,
Spacing = 0,
};
var additional = new Label
{
FontFamily = Fonts.DIN,
HorizontalOptions = LayoutOptions.StartAndExpand,
VerticalOptions = LayoutOptions.Start,
FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)),
IsVisible = false,
};
additional.SetBinding(Label.TextProperty, "Id");
contentLayout.Children.Add(description);
contentLayout.Children.Add(time);
contentLayout.Children.Add(line);
card.Children.Add(icon);
card.Children.Add(contentLayout);
grid.Children.Add(card, 0, 0);
return grid;
});
- Whether the issue replicates only in particular devices? If yes, please share the device configurations.
Only happens on iPhone
- Whether the performance lagging reproduces only in particular pages or layouts?
Because there's only one layout that implement the swipe, so it only happens on the layout.
- Have you adapted the template selector concept in the swipe templates in your application?
I don't know how to use it.
- If possible, please replicate the issue in a sample and revert us with the replication procedure or in a video link.
I'm trying to replicate the issue now.
Thanks,
Rewaldy