GradientBrushes are not supported on Shape.Stroke #21983
Labels
area-drawing
Shapes, Borders, Shadows, Graphics, BoxView, custom drawing
migration-compatibility
Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert
platform/android 🤖
platform/iOS 🍎
s/triaged
Issue has been reviewed
s/verified
Verified / Reproducible Issue ready for Engineering Triage
t/bug
Something isn't working
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
The text was updated successfully, but these errors were encountered: