Skip to content

[iOS] CollectionView containing a Footer and a Border with StrokeThickness set to decimal value crashes on scroll #20294

@MichaelShapiro

Description

@MichaelShapiro

Description

If CollectionView has the following:

  1. Enough item elements to be scrollable (vertically)
  2. <CollectionView.Footer> element. I have just a content view of a certain height.
        <CollectionView.Footer>
            <ContentView HeightRequest="100"></ContentView>
        </CollectionView.Footer>
  1. Each item contains a Border with StrokeThickness set to a decimal value (0.6 for instance)
        <CollectionView.ItemTemplate>
            <DataTemplate x:DataType="x:String">
                <Border StrokeThickness="0.6">
                    <Label
                        Text="{Binding}"
                        FontSize="20"/>
                </Border>
            </DataTemplate>
        </CollectionView.ItemTemplate>

then when you scroll up and then down the app crashes becasue of

Fatal error: <UICollectionView 0x28398dec0> is stuck in its recursive layout loop.

Full code is linked below.

This occurs only in iOS and maui version 8.0.6

	<ItemGroup>
		<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />
		<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.6" />
	</ItemGroup>

IMG_0013.mov

Steps to Reproduce

No response

Link to public reproduction project repository

https://github.com/MichaelShapiro/MauiBugs/tree/master

Version with bug

8.0.6

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.3

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

I found three options to choose from:

  1. Downgrading to maui 8.0.3

  2. Getting rid of the CollectionView Footer

  3. Using only whole number for the StrokeThickness value, such as 1

Relevant log output

UIKitCore/_UICollectionViewFeedbackLoopDebugger.swift:87: Fatal error: <UICollectionView 0x28398dec0> is stuck in its recursive layout loop. This can happen when self-sizing views do not return consistent sizes, or the collection views frame/bounds/contentOffset is being constantly adjusted. To debug this issue, check the Console app for logs in the "UICollectionViewFeedbackLoopDebugger" category.
Collection view: <UICollectionView: 0x1109f7e00; frame = (0 0; 355 704); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x28392b060>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x2832611a0>; contentOffset: {0, 375.5}; contentSize: {355, 1252}; adjustedContentInset: {0, 0, 100, 0}; layout: <Microsoft_Maui_Controls_Handlers_Items_ListViewLayout: 0x10be4a940>; dataSource: <Microsoft_Maui_Controls_Handlers_Items_ReorderableItemsViewController_1: 0x10bfd1400>>

The app has been terminated.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions