Skip to content

Shadow with minus offset clipped left and top on Android #9539

Closed

Description

@shawyunz

Description

Shadow with minus offset value not working on Android. Looks like the shadow is clipped on the left and top.
Tested ok on iOS and Windows.

Android 8.1
image

Android 11
image

Steps to Reproduce

Create an empty MAUI project and add shadow on board as below.

<VerticalStackLayout
        Padding="30,0"
        Spacing="0"
        BackgroundColor="Gray">

        <BoxView
            WidthRequest="100"
            HeightRequest="100"
            Margin="20"
            BackgroundColor="Black">
            <BoxView.Shadow>
                <Shadow Brush="White" Offset="40,40" />
            </BoxView.Shadow>
        </BoxView>

        <Border
            WidthRequest="100"
            HeightRequest="100"
            Margin="40"
            BackgroundColor="Transparent"
            StrokeThickness="5">
            <Border.Shadow>
                <Shadow
                    Opacity="1"
                    Brush="White"
                    Offset="40,40" />
            </Border.Shadow>
        </Border>

        <Border
            WidthRequest="100"
            HeightRequest="100"
            Margin="40"
            BackgroundColor="Transparent"
            StrokeThickness="5">
            <Border.Shadow>
                <Shadow
                    Opacity="1"
                    Brush="White"
                    Offset="-50,-50" />
            </Border.Shadow>
        </Border>
    </VerticalStackLayout>

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 8.1, Android 11, Android 12

Did you find any workaround?

Not found.

Relevant log output

No response

Activity

  1. changed the title [-]Shadow with minus offset not working on Android[/-] [+]Shadow with minus offset clipped left and top on Android[/+] on Aug 19, 2022
  2. added
    s/triagedIssue has been reviewed
    s/verifiedVerified / Reproducible Issue ready for Engineering Triage
    on May 19, 2023
  3. Zhanglirong-Winnie commented on May 19, 2023

    @Zhanglirong-Winnie

    Verified this issue with Visual Studio Enterprise 17.6.0 Preview 7.0. Repro on android platform with above code.
    Screenshot 2023-05-19 141530

  4. added this to the Backlog milestone on Nov 3, 2023
  5. mattleibow commented on Nov 3, 2023

    @mattleibow
    Member

    This is still happening with .NET 8

  6. awp-sirius commented on May 1, 2024

    @awp-sirius

    I have the same problem in the Android Emulator Pixel 6a, android version 9 (API 28), 420 dpi 1080x2340
    .NET 8.0
    Microsoft.Maui.Controls 8.0.21

    image

    <Button.Shadow>
        <Shadow Offset="0,5" Brush="Black" Opacity="1" Radius="70"/>
    </Button.Shadow>
    
  7. ArunachalamSyncfusion commented on May 20, 2024

    @ArunachalamSyncfusion

    Are any updates on this issue or a workaround available? This is high priority for us

  8. FreakyAli commented on Oct 8, 2024

    @FreakyAli

    Any updates here @Zhanglirong-Winnie?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-drawingShapes, Borders, Shadows, Graphics, BoxView, custom drawingplatform/androids/triagedIssue has been revieweds/verifiedVerified / Reproducible Issue ready for Engineering Triaget/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions