-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[iOS] Fix for CollectionView with horizontal grid layout has extra space on right end #25825
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+14.3 KB
...stCases.Android.Tests/snapshots/android/CollectionViewHorizontalItemSpacing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
src/Controls/tests/TestCases.HostApp/Issues/Issue25433.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
x:Class="Maui.Controls.Sample.Issues.Issue25433" | ||
xmlns:ns="clr-namespace:Maui.Controls.Sample.Issues"> | ||
<Grid RowDefinitions="*"> | ||
<CollectionView Grid.Row="0" | ||
x:Name="collectionView" | ||
AutomationId="collectionView" | ||
Background="Red" | ||
HorizontalOptions="Center"> | ||
<CollectionView.ItemsLayout> | ||
<GridItemsLayout Orientation="Horizontal" | ||
HorizontalItemSpacing="10"/> | ||
</CollectionView.ItemsLayout> | ||
<CollectionView.ItemTemplate> | ||
<DataTemplate> | ||
<Label BackgroundColor="Blue" | ||
Text="Item"/> | ||
</DataTemplate> | ||
</CollectionView.ItemTemplate> | ||
</CollectionView> | ||
</Grid> | ||
</ContentPage> |
25 changes: 25 additions & 0 deletions
25
src/Controls/tests/TestCases.HostApp/Issues/Issue25433.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Maui.Controls.Sample.Issues; | ||
|
||
[Issue(IssueTracker.Github, 25433, "Collection view with horizontal grid layout has extra space on right end", PlatformAffected.iOS)] | ||
public partial class Issue25433 : ContentPage | ||
{ | ||
public IList<Issue25433TestItem> Items { get; set; } | ||
|
||
public Issue25433() | ||
{ | ||
InitializeComponent(); | ||
BindingContext = this; | ||
Items = | ||
[ | ||
new Issue25433TestItem() { Name = "Item 1" }, | ||
new Issue25433TestItem() { Name = "Item 2" }, | ||
new Issue25433TestItem() { Name = "Item 3" }, | ||
]; | ||
collectionView.ItemsSource = Items; | ||
} | ||
|
||
public class Issue25433TestItem | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue25433.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#if !MACCATALYST || !WINDOWS | ||
using NUnit.Framework; | ||
using UITest.Appium; | ||
using UITest.Core; | ||
|
||
namespace Microsoft.Maui.TestCases.Tests.Issues | ||
{ | ||
public class Issue25433 : _IssuesUITest | ||
{ | ||
public override string Issue => "Collection view with horizontal grid layout has extra space on right end"; | ||
|
||
public Issue25433(TestDevice device) | ||
: base(device) | ||
{ } | ||
|
||
[Test] | ||
[Category(UITestCategories.CollectionView)] | ||
public void CollectionViewHorizontalItemSpacing() | ||
{ | ||
App.WaitForElement("collectionView"); | ||
|
||
VerifyScreenshot(); | ||
} | ||
} | ||
} | ||
#endif |
Binary file added
BIN
+13.5 KB
...tests/TestCases.iOS.Tests/snapshots/ios/CollectionViewHorizontalItemSpacing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
VerifyScreenshot is not implemented on Catalyst yet. Should not be necessary to avoid in that platform.
Why avoid it on Windows?
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.
@jsuarezruiz, It seems that item spacing on the Windows platform is still not functioning correctly, so I am skipping the Windows platform for now. For your reference, I have attached the related issue report #11320. How can we proceed with this? Please share your thoughts.
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.
Could you include a comment in code with a reference to the issue #11320?
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.
@jsuarezruiz, I have added a comment. Could you please check and provide your concerns if any?