-
Notifications
You must be signed in to change notification settings - Fork 1.9k
GradientBrushes are not supported on Shape.Stroke #21983
Copy link
Copy link
Open
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingdelightermigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androidplatform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/enhancement ☀️New feature or requestNew feature or request
Milestone
Metadata
Metadata
Assignees
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingdelightermigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-ConvertXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androidplatform/ioss/triagedIssue has been reviewedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering TriageVerified / Reproducible Issue ready for Engineering Triaget/enhancement ☀️New feature or requestNew feature or request
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
When applying a Linear or Radial Gradient Brush to the Stroke property of a Shape (Path, or one of the prebuilt shapes such as Ellipse), the color applied to the Stroke is only the first color defined in the gradient as if it were a SolidColorBrush. A GradientBrush in a Fill or Background has worked as expected.
I could not find a place where this was specifically documented (and this was working in Xamarin.Forms) so I am logging this as a bug. I did find some potentially related issues but they did not specifically address the issue of a gradient on the Stroke property.
Screenshot from the repro app linked below:

I found this on MAUI 8.0.7 but tested 8.0.20 as well.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/crhalvorson/MauiPathGradientRepro
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Yes, this used to work in Xamarin.Forms
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
iOS 17.2, Android 14
Did you find any workaround?
Border.Stroke supports a GradientBrush and can accept a StrokeShape that contains a Path or other shape (see reproduction repo for an example).
Relevant log output
No response