Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to make 3 corner rounded when FrameRenders in Xamrin.Form?

$
0
0

I want to make BottomLeft, TopRight, TopLeft corner to rounded. I have tried with following. But, when text size is bit more, it doesn't show correct design.

I have added my code as following.

For better understanding, I have added image.

Render Code
public class ExtendedFrameRenderer : FrameRenderer
{
public override void Draw (CoreGraphics.CGRect rect)
{
base.Draw (rect);
var elem = (ExtendedFrame)this.Element;
UIRectCorner cornerstoRound = UIRectCorner.AllCorners;
if (elem != null)
{
cornerstoRound = UIRectCorner.BottomLeft | UIRectCorner.TopRight | UIRectCorner.TopLeft;
}

        var path = UIBezierPath.FromRoundedRect(rect, cornerstoRound, new CoreGraphics.CGSize(8, 8));
        var maskLayer = new CAShapeLayer();
        maskLayer.Path = path.CGPath;
        this.Layer.Mask = maskLayer;
    }
}

As my code doesn't represent here correctly, let me add image.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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