-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] Button backgroundcolor not working if canexecute is false #14867
Comments
Please do not post code as screenshots, then I will all have to type it over which doesn't help getting this resolved quicker :) Also, would you mind adding a little sample application that shows this problem? |
sorry for the screenshot, I thought it would be easier to read as it's colored, compared to the code tag:
What do you mean a sample of application? because the screenshots I sent are from the android emulator. But here is a full page screenshot The 2 concerned buttons are disabled |
What I mean with a sample application is a reproduction. Try to create a new Xamarin.Forms application, add a button and see if it behaves the same way there. That will help us determine if it is indeed a bug in the Xamarin.Forms library, or maybe something in your code that is causing this. Also, it will help us see all the code you added to that sample project in order to lead up to the bug. That way we can see clearly what code is involved and diagnose quicker. |
Ok here we go: I just created a new fresh Shell App. I just added 3 buttons exactly the same on the AboutPage.Xaml. You can find the full code here I paste images of the code for visibility (you have the text code in the repository) |
This is wonderful, thank you! |
And it seems I'm not the only one having this issue: |
I also noticed if, I change the color while running the app (hot reload), the color is fine |
The Blue color is from a Style at App level. Said that, setting the BackgroundColor property must apply a color regardless of style or state. |
Description
The button background color is ignored if the canexecute is false. Once it becomes true, the background color becomes blue even if you set another color
Steps to Reproduce
Basic Information
Screenshots
if SubscribedSession is null, the button is disabled and the color is blue (which I didn't set!)
if SubscribedSession is not null, the button is enable and the color is blue (which I didn't set!)
If I force the canexecute to true, the button is enabled and the color is fine
The text was updated successfully, but these errors were encountered: