Skip to content

CollectionView inside invisible StackLayout doesn't show on iOS #28263

@vpshonyak

Description

@vpshonyak

Description

CollectionView inside invisible StackLayout doesn't show when IsVisible changed to True

Steps to Reproduce

  1. Create new MAUI
  2. Add to MainPage.xaml the following:
    <StackLayout> <Button Text="Show/Hide" Clicked="Button_Clicked" /> <StackLayout x:Name="StackLayout1" IsVisible="False"> <CollectionView> <CollectionView.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>Item 1</x:String> <x:String>Item 2</x:String> <x:String>Item 3</x:String> </x:Array> </CollectionView.ItemsSource> </CollectionView> </StackLayout> <CollectionView x:Name="CollectionView2" IsVisible="False"> <CollectionView.ItemsSource> <x:Array Type="{x:Type x:String}"> <x:String>Item 1</x:String> <x:String>Item 2</x:String> <x:String>Item 3</x:String> </x:Array> </CollectionView.ItemsSource> </CollectionView> </StackLayout>
  3. Add to MainPage.xaml.cs:
    private void Button_Clicked(object sender, EventArgs e) { StackLayout1.IsVisible = !StackLayout1.IsVisible; CollectionView2.IsVisible = !CollectionView2.IsVisible; }
  4. Run app on iPhone simulator or device

Link to public reproduction project repository

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

Version with bug

9.0.40 SR4

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

No response

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    t/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions