Skip to content

[iOS] Button background not appearing when setting Gradient and Shadow #12959

Closed

Description

@riccardominato

Description

I was trying to create a button with a shadow and setting a gradient as background.

On iOS the rendered button has a transparent background and has no shadow.
If I trigger Hot Reload on gradient, background and shadow appear.

Steps to Reproduce

  1. Create a button.
  2. Set the Button.Shadow property.
  3. Set the Button.Background property to a gradient.

Expected result (Android)*

Actual result (iOS)

* The shadow is actually not perfect even in Android. You can notice that it's cut at the button bottom.

Link to public reproduction project repository

https://github.com/Riccardo11/MauiIssues/tree/main/ButtonWithGradientAndShadow

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, macOS

Affected platform versions

iOS 16.2, MacOS 12.6

Did you find any workaround?

Wrapping the button inside a Border control and setting Shadow and Gradient Background for the Border seems to do the job.

Relevant log output

No response

Activity

  1. changed the title [-][iOS] Button background not working when setting Gradient and Shadow[/-] [+][iOS] Button background not appearing when setting Gradient and Shadow[/+] on Jan 27, 2023
  2. added
    legacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor
    on Jan 27, 2023
  3. added
    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawing
    on Jan 30, 2023
  4. added this to the Backlog milestone on Jan 30, 2023
  5. self-assigned this
    on Jan 30, 2023
  6. modified the milestones: Backlog, on Jul 26, 2023
  7. s-beji commented on Dec 6, 2023

    @s-beji

    This issue is still present in the lastest version of Maui and iOS just it behaves slightly differently

  8. modified the milestones: , Backlog on Aug 2, 2024
  9. added
    partner/syncfusionIssues / PR's with Syncfusion collaboration
    s/try-latest-versionPlease try to reproduce the potential issue on the latest public version
    on Feb 18, 2025
  10. riccardominato commented on Feb 18, 2025

    @riccardominato
    Author

    It seems solved with 9.0.40.

  11. locked and limited conversation to collaborators on Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawinglegacy-area-controlsLabel, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editorpartner/syncfusionIssues / PR's with Syncfusion collaborationplatform/iost/bugSomething isn't working

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions