Dear Forum Members,
I have a working app made with Xamarin.Forms, but unfortunately the performance of my listview is - on iOS - very slow. I tested with my iPhone 4 and the performance is not acceptable at all. On android the performance is great.
This is how it looks like and what I want:
Here is the code of the ViewCell I'm using. Do you see anything I could optimize for this or asked different - how can I achieve the desired listview layout so the performance is OK for iOS?
I hope someone can help me and best Regards
Sebastian
public class CodeProfileCell : ViewCell
{
public CodeProfileCell()
{
var image = new CircleImage(){
BorderColor = Color.White,
BorderThickness = 3,
HeightRequest = 55,
WidthRequest = 55,
Aspect = Aspect.AspectFill,
HorizontalOptions = LayoutOptions.EndAndExpand,
VerticalOptions = LayoutOptions.StartAndExpand
};
image.SetBinding (CircleImage.SourceProperty, "Img");
Label Line1Label = new Label(){FontFamily="Helevtiva-Oblique", FontSize=12 , TextColor = Color.White};
Line1Label.SetBinding(Label.TextProperty, "Line1");
Label Line2Label = new Label (){FontSize = 10};
Line2Label.SetBinding(Label.TextProperty, "Line2");
Label Line3Label = new Label (){FontSize = 10};
Line3Label.SetBinding(Label.TextProperty, "Line3");
StackLayout ProfileInformationStack = new StackLayout () {
Orientation = StackOrientation.Vertical,
Spacing = 3,
Children = {Line1Label, Line2Label, Line3Label}
};
var grid = new Grid
{
RowSpacing = 0,
ColumnSpacing = 0,
Padding = new Thickness(0),
VerticalOptions = LayoutOptions.EndAndExpand,
RowDefinitions =
{
new RowDefinition {Height = GridLength.Auto},
},
ColumnDefinitions =
{
new ColumnDefinition {Width = GridLength.Auto },
new ColumnDefinition {Width = 20 },
new ColumnDefinition {Width = GridLength.Auto}
}
};
grid.Children.Add(image, 0, 0);
grid.Children.Add(ProfileInformationStack, 2, 0);
this.View = grid;
}
}