Hey guys!
I'm currently developping an application with xamarin in C# for ios and Android and I've come with performance issues.
I have 2 pages that are problematic but it may be for the same reason so to keep it simple I'll only use my first exemple.
So basically the page is only text, a couple paragraph and some images.
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="5">
<Image Source="degrade_gris.png" Aspect="Fill" />
</Grid>
<Grid Grid.Row="0" Grid.Column="2" x:Name="Menu">
<Label x:Name="menu" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" TextColor="Black" FontSize="Large" FontAttributes="Bold"/>
<ContentView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" Grid.Row="0">
</ContentView>
</Grid>
<Grid Grid.Row="0" Grid.Column="1" x:Name="bars">
<Image Source="menu_icon.png"/>
<ContentView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<ContentView.GestureRecognizers>
<TapGestureRecognizer Tapped="OuvrirMenu"/>
</ContentView.GestureRecognizers>
</ContentView>
</Grid>
<Grid Grid.Row="0" Grid.Column="3">
<Image Source="home.png" x:Name="home"/>
<ContentView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<ContentView.GestureRecognizers>
<TapGestureRecognizer Tapped="Retour"/>
</ContentView.GestureRecognizers>
</ContentView>
</Grid>
<ScrollView BackgroundColor="#484848" Grid.Row="1" Grid.ColumnSpan="5">
<StackLayout Orientation="Vertical" BackgroundColor="#484848">
<Image Source="CRPD_blanc.png" HeightRequest="100" Margin="0,15,0,0"/>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">first paragraph.</Label>
<Image Source="icon_flag" HeightRequest="75" Margin="0,15,0,0"/>
<Label HorizontalTextAlignment="Center" TextColor="#B1B1B1" FontSize="Large" FontAttributes="Bold">MANDAT</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">another paragraph</Label>
<Image Source="icon_story" HeightRequest="75" Margin="0,15,0,0"/>
<Label HorizontalTextAlignment="Center" TextColor="#B1B1B1" FontSize="Large" FontAttributes="Bold">HISTORIQUE</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" FontAttributes="Bold" Margin="15">1997, « LE DÉBUT »</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph.
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" FontAttributes="Bold" Margin="15">2007, 10IÈME ANNIVERSAIRE DU COMITÉ</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" FontAttributes="Bold" Margin="15">2011, « POUR NE PAS PERDRE LE NORD »</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" FontAttributes="Bold" Margin="15">2018, « BEST BRO »</Label>
<Label HorizontalTextAlignment="Start" TextColor="#B1B1B1" Margin="15">
another paragraph
</Label>
<Image Source="icon_membres" HeightRequest="75" Margin="0,15,0,0"/>
<Label HorizontalTextAlignment="Center" TextColor="#B1B1B1" FontSize="Large" FontAttributes="Bold">MEMBRES DU COMITÉ</Label>
<Image Source="partenaire" Margin="15"/>
</StackLayout>
</ScrollView>
</Grid>
</ContentPage.Content>
I use a grid with 2 row and 5 column,
first row is the header, (button,title,button)
second row is columnspan 5 and is a scrollview with all my text.
Why does this lag so badly?
What does xamarin do in the background? it is as if it calculate labels wrapping on each frame.
Is this the right way to do it?
My other page have stacklayouts in stacklayouts, is this a problem?
Thank you!