I found this link for doing it in Swift: What's the best way to add a drop shadow to my UIView
However when I adapt the solution to Xamarin, no shadow appears.
public override void ViewDidLayoutSubviews()
{
base.ViewDidLayoutSubviews();
UIBezierPath path = new UIBezierPath();
PreviousButton.Layer.MasksToBounds = false;
PreviousButton.Layer.ShadowColor = UIColor.Gray.CGColor;
PreviousButton.Layer.ShadowOffset = new CoreGraphics.CGSize(0f, 7f);
PreviousButton.Layer.ShadowOpacity = 1;
PreviousButton.Layer.ShadowPath = path.CGPath;
}
I am using AutoLayout.