Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hidden ListView doesn't appear as expected #27630

Open
vpshonyak opened this issue Feb 7, 2025 · 4 comments · May be fixed by #27648
Open

Hidden ListView doesn't appear as expected #27630

vpshonyak opened this issue Feb 7, 2025 · 4 comments · May be fixed by #27648
Labels
area-controls-listview ListView and TableView platform/android 🤖 platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@vpshonyak
Copy link

vpshonyak commented Feb 7, 2025

Description

If ListView initially invisible, then attempt to make it visible fails

Steps to Reproduce

  1. Create new .NET MAUI app;
  2. Add XAML to your MainPage.xaml:
<StackLayout>
    <Button Text="Show/Hide ListView" Clicked="Button_Clicked" />
    <ListView x:Name="ListView1" IsVisible="False">
        <ListView.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>
        </ListView.ItemsSource>
    </ListView>
</StackLayout>
  1. Add code:
        private void Button_Clicked(object sender, EventArgs e)
        {
            ListView1.IsVisible = !ListView1.IsVisible;
        }
  1. Run your app;
  2. Tap the 'Show/Hide ListView' button several times;

Expected behavior: ListView should shows up after the first tap;

Actual behavior: on Android ListView shows up only after 3rd tap; on iPhone ListView never shows up.

Link to public reproduction project repository

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

Version with bug

9.0.30 SR3

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

No response

Affected platforms

iOS, Android

Affected platform versions

No response

Did you find any workaround?

On Android works if 'ListView1.IsVisible = !ListView1.IsVisible;' replaced with:

ListView1.IsVisible = !ListView1.IsVisible;
ListView1.IsVisible = !ListView1.IsVisible;
ListView1.IsVisible = !ListView1.IsVisible;

Relevant log output

@vpshonyak vpshonyak added the t/bug Something isn't working label Feb 7, 2025
Copy link

We've found some similar issues:

If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.

Note: You can give me feedback by 👍 or 👎 this comment.

@Zhanglirong-Winnie Zhanglirong-Winnie added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Feb 7, 2025
@Zhanglirong-Winnie
Copy link

This issue has been verified Visual Studio 17.13 Preview 5(9.0.30 & 9.0.22). Can repro this issue on Android and iOS platforms.

@jsuarezruiz jsuarezruiz added this to the .NET 9 Servicing milestone Feb 7, 2025
@PureWeen PureWeen modified the milestones: .NET 9 Servicing, Backlog Feb 7, 2025
@PureWeen
Copy link
Member

PureWeen commented Feb 7, 2025

@vpshonyak can you try CollectionView? We aren't heavily prioritizing ListView issues currently but really want to make sure people are unblocked to move to CollectionView.

@vpshonyak
Copy link
Author

@PureWeen CollectionView works fine.

@kubaflo kubaflo linked a pull request Feb 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-listview ListView and TableView platform/android 🤖 platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants