Xamarin Forms Frame Shadow Design
I have implemented something very similar (also Frame
s as cards to be displayed in a stack view). Unfortunately I can't share the exact code, for it's not me owning it, but my employer, but I can tell you how to achieve this.
I have added a property ShadowRadius
to CardView
and created a custom renderer, derived from Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer
. In the renderer I am setting the Elevation
of the renderer
protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
/* ... */
this.Elevation = ((CardView)e.NewElement).ShadowRadius;
}
My cards are showing a nice elevation shadow with Xamarin.Forms 2.5.0.280555.