I used to use the Frame control of Xamarin.Forms as a CardView for Android, but I updated the Xamarin.Forms package to version 3.1.0 and the frame appearence has changed. It doesn't have elevation and shadows. I tried to create a custom renderer, but doesn't work.
To explain what I'm trying to say, see the pictures below. First picture is the old behaviour of frame. The appearence is exactly like CardView in Android and the second picture is the new behaviour, for the version 3.1.0 of Xamarin.Forms. The frame doesn't have elevation and shadows.
That's the old appearence
That's the new appearence in xamarin.forms 3.1.0
I don't see this in my XF 3.1 app. Are you sure you don't have a custom renderer overriding the way the frame is displayed?
Actually, I use a control that extends frame. I named it CardView, but, for Android platform, it changes nothing. My CardView class have differences only for iOS and I tested modifying the CardView for a simple frame and the result was the same.
public class CardView : Frame
{
public CardView()
{
Padding = 0;
if (Device.RuntimePlatform == Device.iOS)
{
HasShadow = false;
BorderColor = Color.Transparent;
BackgroundColor = Color.Transparent;
}
}
}
Frame appears to render identically for me in 3.0.0 and 3.1.0. Can you please test the attached project and alter it such that it exhibits the issue? Thank you!
Issue3532.zip
3.0.0
3.1.0
I tested the project that you send me and the same problem occurs here. I didn't change nothing, just open the project, build and run. I created a simple "Hello Xamarin Forms!" project too and the problem continues.
I posted the project that I created on GitHub. There is the link.
I did many tests here with different versions of Xamarin Forms package. With versions >= 3.0.0, the behaviour was random. Sometimes, Frame appearence was like CardView in android, but sometimes was like I posted. After, I tested with version 2.5.1 and works like a charm
I tested in Android 6.0 (Marshmallow) and in 5.1 (Lollipop)
Are you using an emulator or device? Which one?
I tested in a device with Android 6.0 and in emulator with Android 5.1.
On a device with Android 7.1 (API 15), the frame in the repro project looks fine. When I run it on an emulator with API 21, I'm seeing the flattened version:
My results were with XF 3.1.
It's still there in same sample project with Forms 4.7. There is no way as of now to add shadow. Can any one please make this issue as high priority ? Two year old bug and still exists with latest forms version.
Most helpful comment
It's still there in same sample project with Forms 4.7. There is no way as of now to add shadow. Can any one please make this issue as high priority ? Two year old bug and still exists with latest forms version.