-
Notifications
You must be signed in to change notification settings - Fork 2k
[iOS][CV2] Fix page can be dragged down, and it would cause an extra space between Header and EmptyView text #31840
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
0ed81fa
d8d3282
b3c4c07
cc17f44
1d95e88
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,68 @@ | ||||
| using System.Collections.ObjectModel; | ||||
|
|
||||
| namespace Maui.Controls.Sample.Issues; | ||||
|
|
||||
| [Issue(IssueTracker.Github, 31465, "The page can be dragged down, and it would cause an extra space between Header and EmptyView text.", PlatformAffected.iOS)] | ||||
| public class Issue31465 : ContentPage | ||||
| { | ||||
| public Issue31465() | ||||
| { | ||||
| var grid = new Grid | ||||
| { | ||||
| Margin = new Thickness(20), | ||||
| RowDefinitions = | ||||
| { | ||||
| new RowDefinition { Height = GridLength.Auto }, | ||||
| new RowDefinition { Height = GridLength.Star } | ||||
| } | ||||
| }; | ||||
|
|
||||
| // Header Label | ||||
| var headerLabel = new Label | ||||
| { | ||||
| Text = "Test for CollectionView empty view positioning", | ||||
| AutomationId = "HeaderLabel", | ||||
| }; | ||||
| Grid.SetRow(headerLabel, 0); | ||||
| grid.Children.Add(headerLabel); | ||||
|
|
||||
| // CollectionView | ||||
| var collectionView = new CollectionView | ||||
| { | ||||
| AutomationId = "CollectionView", | ||||
| ItemsSource = Array.Empty<string>(), // empty array to trigger EmptyView | ||||
| ItemTemplate = new DataTemplate(() => | ||||
| { | ||||
| return new Label | ||||
| { | ||||
| TextColor = Colors.Black, | ||||
| FontSize = 16, | ||||
| // This binding works with string items | ||||
| BindingContext = "{Binding .}" | ||||
|
||||
| BindingContext = "{Binding .}" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
|
|
||
| public class Issue31465 : _IssuesUITest | ||
| { | ||
| public Issue31465(TestDevice device) : base(device) { } | ||
|
|
||
| public override string Issue => "The page can be dragged down, and it would cause an extra space between Header and EmptyView text."; | ||
| [Test] | ||
| [Category(UITestCategories.CollectionView)] | ||
| public void VerifyCollectionViewEmptyView() | ||
| { | ||
| App.WaitForElement("HeaderLabel"); | ||
| App.Click("CollectionViewHeader"); | ||
| VerifyScreenshot(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pending snapshots, running a build.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsuarezruiz , I have added the snapshots for all platforms |
||
| } | ||
| } | ||
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.
On iOS devices with notches/home indicators, safe area insets; is correct?
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.
Yes @jsuarezruiz , I have ensured the fix with the latest changes on a notch screen device; it’s working fine.
Demo.mov