dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.27k stars 1.76k forks source link

Adding new shadow property to frame not working #7209

Open IeuanWalker opened 2 years ago

IeuanWalker commented 2 years ago

Description

Adding the new shadow property to a frame doesn't do anything.

Steps to Reproduce

This is the xaml -

<ContentView Grid.Row="0"
            Margin="20"
            HorizontalOptions="Center"
            VerticalOptions="End">
    <Frame Padding="0"
        CornerRadius="30"
        HasShadow="False"
        HeightRequest="50">
        <Frame.Background>
            <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                <GradientStop Offset="0.0" Color="#0ED473" />
                <GradientStop Offset="1.0" Color="#17CC54" />
            </LinearGradientBrush>
        </Frame.Background>
        <Frame.Shadow>
            <Shadow Brush="red"
                Opacity="1"
                Radius="10"
                Offset="20,20" />
        </Frame.Shadow>
        <HorizontalStackLayout HorizontalOptions="Fill" VerticalOptions="Fill">

            <Label Grid.Column="1"
                Margin="10"
                FontFamily="LASolid"
                FontSize="30"
                HeightRequest="30"
                HorizontalOptions="CenterAndExpand"
                HorizontalTextAlignment="Center"
                Text="&#xf04b;"
                TextColor="White"
                VerticalOptions="Center"
                WidthRequest="50" />
            <Label Grid.Column="1"
                Margin="10"
                FontFamily="LASolid"
                FontSize="30"
                HeightRequest="30"
                HorizontalOptions="CenterAndExpand"
                HorizontalTextAlignment="Center"
                Text="&#xf067;"
                TextColor="White"
                VerticalOptions="Center"
                WidthRequest="50">
                <Label.GestureRecognizers>
                    <TapGestureRecognizer Tapped="AddExcersie_Tapped" />
                </Label.GestureRecognizers>
            </Label>
        </HorizontalStackLayout>
    </Frame>
</ContentView>

Version with bug

Release Candidate 3 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android, I was not able test on other platforms

Affected platform versions

Android 11

Did you find any workaround?

No response

Relevant log output

No response

v-longmin commented 2 years ago

Verified repro on android 12.0 with VS 17.3.0 Preview 1.0 [32427.505.main]. Repro with above project.

Mous625 commented 2 years ago

Any news on this?

IeuanWalker commented 2 years ago

Any news on this?

You can use the border control instead

ghost commented 2 years ago

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

jmSfernandes commented 2 years ago

I am facing the same issue. VS 17.3.6 It's a bit annoying, but like someone said it's possible to use the Border control to obtain the same look as a frame and implement a custom shadow.

tinhmdxdev commented 1 year ago

Any news on this? It's really annoying!

XamlTest commented 1 year ago

Verified this on Visual Studio Enterprise 17.6.0 Preview 6.0. Repro on Windows 11 and Android emulator (13.0-API 33) with below Project: 7209.zip

image

If use Border control instead of Frame, shadow works well.

Samandar02 commented 1 year ago

I have used Border instead Frame

<Border
    Padding="0"
    Stroke="Transparent">
    <Border.Shadow>
        <Shadow
            Radius="10"
            Brush="Black"
            Opacity="0.5"
            Offset="0,0"/>
    </Border.Shadow>
...

And it works for me on Android