maui
maui copied to clipboard
When an image is used for a IconImageSource all images are using the theme or a different color than the one originally assigned in the .svg after that
Description
if an image imge1.svg is referenced by an IconImageSource as image1.png its color is adapted to the theme (dark or white). Unfortunately if you used the same image in a list item for instance then all the other images referencing image1.png in a template or image button are now using the new color, Not the original color defined in the svg.. NOTE: Works fine on iOS
Steps to Reproduce
if an image imge1.svg is referenced by an IconImageSource as image1.png its color is adapted to the theme (dark or white) but all the other images referencing image1.png in a template or image button are now using the Icon source color, not the original color.
- create a image.svg file with a blue color.
- create a template for a listItem in a list control using an image referencing image.png
- Use a swipeView with a swipeItem using the same image for its IconImageSource="image.png"
- notice that after using the swipeview, the images of your list items gets the same color.
Link to public reproduction project repository
No response
Version with bug
8.0.20 SR4
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
No response
Did you find any workaround?
Create a duplicate .svg image for IconImageSource
Relevant log output
No response
Here
Hi @pierre01. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md
This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Here is the repo that reproduces it:
https://github.com/pierre01/IconImageSourceBug
Verified this issue with Visual Studio 17.10.0 Preview 4(8.0.20). Not repro on android platform with sample project.
Hi @kevinxufei those are not the original colors please notice how the original icons are blue to start with and should not change to white.... but yes when all icons are set to white nothing new happens. Look closely at the screen when you start. There is no reason that the template icons change color based on the swipeview bottons color
https://github.com/dotnet/maui/assets/2603287/d48685ec-2cd9-4cf1-8205-8a5e9c845a07
Tried with the latest! Still the issue is there. there is no reason the image buttons in my UI turn from purple to white after using the swipeView
Thank you for your reply. I can repro this issue!