Forum Xamarin.Forms

Slow performance inside ListView with images

I have a problem, I am using inside my listview images from Url, every time I scroll a list it is laging soo much. I am using default images from xamarin forms:

 <RelativeLayout>
                        <Frame
                            Margin="{Binding PictureMargin}"
                            Padding="0"
                            CornerRadius="{Binding CornerRadius}"
                            HasShadow="False"
                            HeightRequest="{Binding Size}"
                            IsClippedToBounds="True"
                            IsVisible="{Binding IsProfilePicture}"
                            WidthRequest="{Binding Size}">
                            <Image Aspect="AspectFill" Source="{Binding ProfilePicture}" />
                        </Frame>
                        <Frame
                            Margin="{Binding PictureMargin}"
                            Padding="0"
                            BackgroundColor="#4074DD"
                            CornerRadius="{Binding CornerRadius}"
                            HeightRequest="{Binding Size}"
                            HorizontalOptions="Center"
                            IsVisible="{Binding IsInitials}"
                            VerticalOptions="FillAndExpand"
                            WidthRequest="{Binding Size}">
                            <Label
                                FontSize="{Binding TextSize}"
                                HorizontalOptions="Center"
                                Text="{Binding Initials}"
                                TextColor="White"
                                VerticalOptions="Center" />
                        </Frame>
                        <Frame
                            Margin="{Binding CompanyPictureMargin}"
                            Padding="0"
                            BackgroundColor="Transparent"
                            CornerRadius="{Binding CompanyCornerRadius}"
                            HasShadow="False"
                            HeightRequest="{Binding CompanyPictureSize}"
                            HorizontalOptions="Center"
                            IsClippedToBounds="True"
                            IsVisible="{Binding IsCompanyPicture}"
                            WidthRequest="{Binding CompanyPictureSize}">
                            <Image Source="{Binding CompanyPicture}" />
                        </Frame>
                        <Frame
                            Margin="{Binding PictureMargin}"
                            Padding="0"
                            BackgroundColor="#aaaaaa"
                            CornerRadius="{Binding CornerRadius}"
                            HeightRequest="{Binding Size}"
                            HorizontalOptions="Center"
                            IsVisible="{Binding IsExtraCounter}"
                            VerticalOptions="FillAndExpand"
                            WidthRequest="{Binding Size}">
                            <Label
                                FontSize="{Binding TextSize}"
                                HorizontalOptions="Center"
                                Text="{Binding ExtraCountText}"
                                TextColor="White"
                                VerticalOptions="Center" />
                        </Frame>
                    </RelativeLayout>

I am using this view inside my listView

<ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <Frame
                                Margin="20,10"
                                Padding="2"
                                BackgroundColor="White"
                                CornerRadius="12"
                                HasShadow="False"
                                HeightRequest="130">
                                <Grid
                                    Margin="10"
                                    ColumnSpacing="0"
                                    RowSpacing="8">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Frame
                                        Grid.Row="0"
                                        Grid.Column="0"
                                        Margin="0,0,10,0"
                                        Padding="0"
                                        BackgroundColor="{Binding StatusOfMeetingColor}"
                                        CornerRadius="5"
                                        HasShadow="False"
                                        HeightRequest="10"
                                        VerticalOptions="Center"
                                        WidthRequest="10" />
                                    <Label
                                        Grid.Row="0"
                                        Grid.Column="1"
                                        Grid.ColumnSpan="2"
                                        Margin="0"
                                        FontAttributes="Bold"
                                        FontSize="18"
                                        LineBreakMode="TailTruncation"
                                        Text="{Binding CreatorDisplayName}"
                                        TextColor="Black"
                                        VerticalOptions="Center" />
                                    <customViews:UsersPictures
                                        Grid.Row="0"
                                        Grid.Column="3"
                                        Margin="0"
                                        Padding="0"
                                        UserList="{Binding UserPicturesItems}" />

I know that the images make this problem, because when I comment them performance of the list is much better. What is more this images flicker. Anyone have this problem ?

Answers

Sign In or Register to comment.