Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Shadow CustomRenderer for iOS dismisses cornerRadius?

$
0
0

Hi, I have found this custom renderer for making shadows on a frame look better, but...

When using the custom renderer I do not have the option for rounded corners anymore.

How do I accomplish both?

    [assembly: ExportRenderer(typeof(Frame), typeof(MaterialFrameRenderer))]
    namespace md.iOS.CustomRenderers
    {
        public class MaterialFrameRenderer : FrameRenderer
        {
            public override void Draw(CGRect rect)
            {
                base.Draw(rect);

                // Update shadow to match better material design standards of elevation
                Layer.ShadowRadius = 2.0f;
                Layer.ShadowColor = UIColor.Gray.CGColor;
                Layer.ShadowOffset = new CGSize(2, 2);
                Layer.ShadowOpacity = 0.80f;
                Layer.ShadowPath = UIBezierPath.FromRect(Layer.Bounds).CGPath;
                Layer.MasksToBounds = false;
            }
        }
    }

Hoping for help and thanks in advance :-)


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>