-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[iOS/Mac]Fix StrokeDashArray Property not Rendering #29670
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
Merged
rmarinho
merged 3 commits into
dotnet:inflight/current
from
devanathan-vaithiyanathan:fix-29661
May 28, 2025
Merged
Changes from all commits
Commits
Show all changes
3 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
Binary file added
BIN
+13.7 KB
...s/TestCases.Android.Tests/snapshots/android/VerifyBorderWithStrokeDashArray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,37 @@ | ||
| using System.Collections.ObjectModel; | ||
|
|
||
| namespace Maui.Controls.Sample.Issues; | ||
| [Issue(IssueTracker.Github, 29661, "[iOS, Mac] StrokeDashArray Property not Rendering", PlatformAffected.iOS)] | ||
| public class Issue29661 : ContentPage | ||
| { | ||
| public Issue29661() | ||
| { | ||
| var label = new Label | ||
| { | ||
| Text = "Test for Border with StrokeDashArray", | ||
| AutomationId = "StrokeDashArrayLabel", | ||
| HorizontalOptions = LayoutOptions.Center, | ||
| FontSize = 16 | ||
| }; | ||
|
|
||
| var border = new Border | ||
| { | ||
| HeightRequest = 200, | ||
| WidthRequest = 200, | ||
| BackgroundColor = Colors.LightGray, | ||
| Stroke = Colors.Blue, | ||
| StrokeThickness = 5, | ||
| StrokeDashArray = new DoubleCollection { 10, 5 } | ||
| }; | ||
|
|
||
| var layout = new VerticalStackLayout | ||
| { | ||
| Spacing = 25, | ||
| Padding = new Thickness(30, 60, 30, 30), | ||
| VerticalOptions = LayoutOptions.Center, | ||
| Children = { label, border } | ||
| }; | ||
|
|
||
| Content = layout; | ||
| } | ||
| } |
Binary file added
BIN
+14 KB
...ols/tests/TestCases.Mac.Tests/snapshots/mac/VerifyBorderWithStrokeDashArray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29661.cs
This file contains hidden or 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,21 @@ | ||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Issues; | ||
| public class Issue29661 : _IssuesUITest | ||
| { | ||
| public override string Issue => "[iOS, Mac] StrokeDashArray Property not Rendering"; | ||
|
|
||
| public Issue29661(TestDevice device) | ||
| : base(device) | ||
| { } | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.Border)] | ||
| public void VerifyBorderWithStrokeDashArray() | ||
| { | ||
| App.WaitForElement("StrokeDashArrayLabel"); | ||
| VerifyScreenshot(); | ||
| } | ||
| } | ||
Binary file added
BIN
+7.92 KB
...sts/TestCases.WinUI.Tests/snapshots/windows/VerifyBorderWithStrokeDashArray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.4 KB
...ols/tests/TestCases.iOS.Tests/snapshots/ios/VerifyBorderWithStrokeDashArray.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -417,7 +417,7 @@ void DrawGradientPaint(CGContext graphics, Paint paint) | |
|
|
||
| bool IsBorderDashed() | ||
| { | ||
| return _strokeDash != null && _strokeDashOffset > 0; | ||
|
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. This property determines the starting point of the dash pattern along the stroke. A negative value shifts the dash pattern in the opposite direction, which can be useful in some cases. |
||
| return _strokeDash != null; | ||
| } | ||
| } | ||
| } | ||
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.
Pending snapshots already available in the latest build.

Could you commit the images?
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 the snapshots for all platforms. Please let me know if any concerns