-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use LinearGradientBrush as Button Background on iOS #20218
Comments
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process. |
I'm having the same issue. Hope this gets resolved soon. |
I've had the same issue ever since I started working on the iOS version of my app (Android works fine). I've noticed that the buttons get drawn correctly if I somehow cause a refresh of the page (e.g. by navigating to another page and then back). |
This is happening with a few different controls. I have the same problem with grids, labels and buttons so I'm having to use solid colours on iOS for now. |
I am having same issue. |
What is the status of this issue? Is there a solution or any estimated time remaining? |
Not ideal but wrapping the control within a Border seems to keep the gradient contained. You have to use the border stroke shape to control gradient overflow.
|
@afk013 Thank you for this workaround, but this can´t be the official way to go.. We are moving our apps from xamarin to maui and we already got lots of things to check like change StackLayout with AndExpand to a Grid. We can´t set a Border around every element wich uses a gradient. Especially after it works correct for Android but not on iOS. Maybe some of the MAUI/Microsoft guys could look into this. |
The problem discuss in this thread is limited to Buttons only. And you are welcome to wait for MS to fix it, as it on official git of the team working on it, and it is been here for 6 months already. So I suggest to use workaround if you really want gradient button. Virtually no other option. |
Oh man. I see.. Waiting for MS to fix something is in 99% of the time the worse option 😅 |
The workaround has put me back in business; thanks! I had to be careful about matching the |
any updates here? |
Sadly only pots may answer here, no real developers |
Using LinearGradientBrush in iOS button, imagesource also will not be visible. |
Description
Works on Android (tested on Pixel 7 API 34 emulator)
![android](https://private-user-images.githubusercontent.com/107032142/300412367-ab1d4b89-d4b1-4e95-acec-af16d39e3011.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJ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1QxODQ4MTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03OWM2NTE2ODAwNTY0M2E4NDI3NmJiOGY0Y2ZmMDMzY2MwYjZkMjU4MTc2MzM1ZjlhZjE1YjZkZDJlOTNiYmI3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.hcMnyawCCg4anfRdw8mwg13oMuh2qh9dL_jMLvg3hQo)
but on iOS (tested on iPhone 15 Pro Max iOS 17.2 emulator)
there is something wrong...
Steps to Reproduce
Link to public reproduction project repository
https://github.com/alececihs/MauiButtonsTest/
Version with bug
8.0.3
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: