I know there are some questions with same head line, but I couldn\'t find any answer that worked for me.
Got in Xml file triple ListBox , which was built from 3 inne
I used the ListBox built-in ScrollViewer instead of ScrollViewer layout and it seems to fix the bug.
<ListBox x:Name="RegistersListView" ItemsSource="{x:Bind registersList}" Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollMode="Enabled">
Performance still not good for more than 50 objects, but this is better than exception. When using ListView instead of ListBox performance is better but the built-in ScrollViewer is not shown. So I don't mark this answer as acceptable.
The ListView version:
<ListView x:Name="RegistersListView" ItemsSource="{x:Bind registersList}" Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollMode="Enabled"
I had a few StackLayout
s populated via foreach
loops. They were each contained within a ScrollViewer
of fixed height.
When the content was too great, it started to crash with the obscure 'layout cycle detected' error..
I changed the StackLayout
s to Grid
s, and finally this extremely annoying problem was solved.
Update: 1 year later my application suffered from the problem again. I fixed it by adding a VerticalAlignment
property to the offending Grid view...