-
Notifications
You must be signed in to change notification settings - Fork 1.9k
.NET MAUI style problem with gradient colors - Android #11601
Copy link
Copy link
Closed
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.58Look for this fix in 7.0.58!Look for this fix in 7.0.58!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/androidt/bugSomething isn't workingSomething isn't working
Milestone
Description
Description
I started using .NET MAUI recently and I found a problem with Styling.
I started with the basic project to make sure the problem is not something I made during the process.
The project starts with a button that will change text and size each time the user press it.
The problem is any time I use LinearGradientBrush directly or through the global styling, the button size doesn't change to fit the text, and even worse it moves to the left.
I looked everywhere but I didn't find any similar problem or solution.
It works well with Windows but not with Android
Code
<Button
x:Name="CounterBtn"
Text="Click me"
SemanticProperties.Hint="Counts the number of times you click"
Clicked="OnCounterClicked"
HorizontalOptions="Center">
<Button.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#8A26ED"/>
<GradientStop Color="#381061" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
Steps to Reproduce
- Create new .NET MAUI app
- Set LinearGradientBrush to the CounterBtn button directly or use global styling.
- When the button click on Android the size doesn't change and the button moves to the left
Link to public reproduction project repository
https://github.com/AbanoubZak/NET-MAUI-gradient-color-styling-problem
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android, I was not able test on other platforms
Affected platform versions
All Android
Did you find any workaround?
Not yet
Relevant log output
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingfixed-in-7.0.100fixed-in-7.0.101fixed-in-7.0.58Look for this fix in 7.0.58!Look for this fix in 7.0.58!fixed-in-8.0.0-preview.1.7762Look for this fix in 8.0.0-preview.1.7762!Look for this fix in 8.0.0-preview.1.7762!platform/androidt/bugSomething isn't workingSomething isn't working

