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

dg2k 1,416 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>
Developer technologies .NET .NET MAUI
Developer technologies C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.