Skip to content

Incorrect layout with RefreshView, CollectionView that has an GridItemsLayout on iPhone #11327

@vpshonyak

Description

@vpshonyak

Description

I'm having an RefreshView with CollectionView that has an GridItemsLayout that should draw two columns of boxes. On Android, it is perfect:
image

But not on iPhone. It shows only odd boxes instead:
image

Steps to Reproduce

1.Create a new MAUI application.
2. Update MainPage.xaml:

`

<RefreshView>
    <CollectionView 
        BackgroundColor="DarkBlue"
        ItemsSource="{Binding Numbers}"
        >
        <CollectionView.ItemsLayout>
            <GridItemsLayout 
                Orientation="Vertical"
                Span="2"
                VerticalItemSpacing="5"
                HorizontalItemSpacing="5" />
        </CollectionView.ItemsLayout>
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <StackLayout HeightRequest="50" BackgroundColor="Purple">
                    <Label Text="{Binding }" TextColor="White" HorizontalOptions="Center" VerticalOptions="Center" />
                </StackLayout>
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>
</RefreshView>

`

  1. Update MainPage.xaml.cs:

`
namespace MauiApp2;

public partial class MainPage : ContentPage
{

public List<int> Numbers { get; } = Enumerable.Range(1, 100).ToList();
public MainPage()
{
	InitializeComponent();
    BindingContext = this;
}

}
`

Link to public reproduction project repository

https://github.com/vpshonyak/MauiApp2.git

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 16.1

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Labels

area-controls-collectionviewCollectionView, CarouselView, IndicatorViewarea-controls-refreshviewRefreshViewfixed-in-8.0.0-preview.4.8333Look for this fix in 8.0.0-preview.4.8333!p/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/ioss/needs-attentionIssue has more information and needs another lookt/bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions