You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Collection View Header and Empty View not showing on Android when ItemSource is null #8934
If the data the CollectionView is bound to is null, then CollectionView.Header and CollectionView.Empty View is not visible. This issue was also tested on the Windows version and the bug does not appear.
A sample of the issue can be found here https://github.com/3steve3/EmptyCollectionViewBug
Steps to Reproduce
Create a new .Net Maui project
Create a viewmodel for the view
Create a Collection View in the View.
Bind the Collection View item source to null variable, CollectionView.Header and CollectionView.EmptyView will not be visible on Android.
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
No
Relevant log output
No response
Reacted by Syed Hoque, José Luis, Max Borrmann, eliebitar, Ronan Burke and David1930
Reacted by Daniel Fang, José Luis, Martin Opdenacker, eliebitar and Echo Lumaque
My application needs to have things in a header (if using a collection view) because stacking content and a collection view results in incorrect scroll height.
cc @davidortinau@jfversluis@PureWeen . This is a basic requirement thats failing us now. Can you please assign resources in this issue please? I know you guys are working hard and really appreciate the work :) Thank you!
Reacted by Mielesplayz, José Luis and Echo Lumaque
This is the general workaround I came up with until the bug is fixed
<ScrollView>
<StackLayout>
This is where the header elements would be
<VerticalStackLayout BindableLayout.ItemsSource="{Binding mySource}">
<BindableLayout.ItemTemplate>
<DataTemplate x:DataType="model:MyModel">
the bindable content here
</DataTemplate>
</BindableLayout.ItemTemplate>
</VerticalStackLayout>
</StackLayout>
</ScrollView>
Activity
danielftz commentedon Aug 29, 2022
ETA on the fix?
99067718 commentedon Sep 16, 2022
I'm pretty sure the header is the problem in your case.
It should be fixed after you remove the header.
3steve3 commentedon Sep 16, 2022
My application needs to have things in a header (if using a collection view) because stacking content and a collection view results in incorrect scroll height.
Syed-RI commentedon Nov 3, 2022
cc @davidortinau @jfversluis @PureWeen . This is a basic requirement thats failing us now. Can you please assign resources in this issue please? I know you guys are working hard and really appreciate the work :) Thank you!
3steve3 commentedon Nov 6, 2022
This is the general workaround I came up with until the bug is fixed
AlexeyStarkov commentedon Feb 1, 2023
CarouselView has the same issue: Empty view doesn't work on Android whether the source collection is null or empty.
13 remaining items
Correctly identify headers/footers when using UngroupedItemsSource
Correctly identify headers/footers when using UngroupedItemsSource (#…
PureWeen commentedon Jun 28, 2023
#15886
Include headers/footers in EmptySource count so they show up when Ite…
Include headers/footers in EmptySource count so they show up when Ite…
Include headers/footers in EmptySource count so they show up when Ite…