Does Maui-Android have an issue with Shadow property for the Border control?

dg2k 1,386 Reputation points
2023-03-27T18:27:32.8933333+00:00

When I define Shadow for the Border control (see XAML code below), Android fails to display. It works fine on WinUI. If I remove Shadow definition in XAML it works for Android.

Does Android have an issue with Shadow?

<Border Stroke="Blue" StrokeThickness="1">
    <Border.StrokeShape>
        <RoundRectangle CornerRadius="9" />
    </Border.StrokeShape>
    <Border.Shadow>
        <Shadow
            Brush="#1E88E5"
            Opacity=".5"
            Radius="4"
            Offset="2,2" />
    </Border.Shadow>
    <Label Text="Test message!" />
</Border>
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,926 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,309 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 36,231 Reputation points Microsoft Vendor
    2023-03-28T01:45:42.6033333+00:00

    Hello,

    After my tests, the Shadow property works fine in Android.

    When I define Shadow for the Border control (see XAL code below), Android fails to display.

    In fact, this is because the Shadow representation is different on WinUI and Android. If you use the following code to increase the shadow, you could see that the shadow works fine.

    <Shadow
    	Brush="red"
    	Opacity="0.8"
    	Offset="10,10"
    	/>
    

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.