Skip to content

Android EmptyView in CollectionView weird resize after screen rotation #15158

@marekm294

Description

@marekm294

Description

Android:
https://github.com/dotnet/maui/assets/108216731/c2c8559d-3771-4287-bc4d-313161f3dbca

iOS:
https://github.com/dotnet/maui/assets/108216731/11785729-7df6-41ad-942e-d41fb8e4035a

Steps to Reproduce

<Grid>
    <CollectionView BackgroundColor="Beige">
        <CollectionView.Behaviors>
            <behaviors:CollectionViewReloadingEmptyViewBehavior />
        </CollectionView.Behaviors>
        <CollectionView.EmptyViewTemplate>
            <DataTemplate>
                <HorizontalStackLayout BackgroundColor="#80000000">
                    <Label Text="No record here"
                       Margin="10,25,10,10"
                       FontAttributes="Bold"
                       FontSize="18"
                       HorizontalOptions="Fill"
                       HorizontalTextAlignment="Center" />
                    <Button Text="AddItem" Clicked="Button_Clicked"/>
                </HorizontalStackLayout>
            </DataTemplate>
        </CollectionView.EmptyViewTemplate>
    </CollectionView>
</Grid>

Link to public reproduction project repository

Version with bug

7.0.86

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 11

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions