-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix CollectionView Header is not visible when ItemsSource is not set and an EmptyView is set in iOS, Mac platform #34989
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
Changes from all commits
448e8e7
a385d33
8caee0c
ebc8ffe
da71e64
1892d1c
e9ff88a
0384d40
05ee0fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| using Microsoft.Maui.Controls; | ||
| using System.Collections.ObjectModel; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
|
|
||
| [Issue(IssueTracker.Github, 34897, "CollectionView Header is not visible when ItemsSource is not set and EmptyView is set", PlatformAffected.iOS | PlatformAffected.macOS)] | ||
| public class Issue34897 : ContentPage | ||
| { | ||
| public Issue34897() | ||
| { | ||
| var collectionView = new CollectionView | ||
| { | ||
| ItemsLayout = new GridItemsLayout(2, ItemsLayoutOrientation.Vertical), | ||
| AutomationId = "Issue34897CollectionView", | ||
| Header = new Label | ||
| { | ||
| Text = "CollectionView Header", | ||
| AutomationId = "Issue34897Header", | ||
| BackgroundColor = Colors.LightBlue, | ||
| }, | ||
| EmptyView = new Label | ||
| { | ||
| Text = "No items available", | ||
| AutomationId = "Issue34897EmptyView", | ||
| BackgroundColor = Colors.LightYellow, | ||
| }, | ||
| Footer = new Label | ||
| { | ||
| Text = "CollectionView Footer", | ||
| AutomationId = "Issue34897Footer", | ||
| BackgroundColor = Colors.LightGreen, | ||
| }, | ||
| }; | ||
|
|
||
| var grid = new Grid | ||
| { | ||
| RowDefinitions = | ||
| { | ||
| new RowDefinition(GridLength.Auto), | ||
| new RowDefinition(GridLength.Star), | ||
| } | ||
| }; | ||
|
|
||
| var label = new Label | ||
| { | ||
| Text = "Header, Footer and EmptyView should all be visible below:", | ||
| }; | ||
|
|
||
| grid.Add(label, 0, 0); | ||
| grid.Add(collectionView, 0, 1); | ||
|
|
||
| Content = grid; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||
| #if TEST_FAILS_ON_WINDOWS // This test fails on Windows because we no longer works with CollectionView on Windows. | ||||||
|
||||||
| #if TEST_FAILS_ON_WINDOWS // This test fails on Windows because we no longer works with CollectionView on Windows. | |
| #if TEST_FAILS_ON_WINDOWS // Excluded on Windows because the CollectionView EmptyView, header, and footer are not reliably accessible via UI Automation there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System.Collections.ObjectModelis not used in this file. Please remove the unused using to avoid IDE0005/style-analyzer noise in builds.