Please refer this screenshot for the design
//Top Left Right Corners
var maskPathTop = UIBezierPath.FromRoundedRect(cell.Bounds, UIRectCorner.TopLeft | UIRectCorner.TopRight, new CoreGraphics.CGSize(8, 8));
var shapeLayerTop = new CAShapeLayer();
shapeLayerTop.Frame = cell.Bounds;
shapeLayerTop.Path = maskPathTop.CGPath;
//Bottom Left Right Corners
var maskPathBottom = UIBezierPath.FromRoundedRect(cell.Bounds, UIRectCorner.BottomLeft | UIRectCorner.BottomRight, new CoreGraphics.CGSize(8, 8));
var shapeLayerBottom = new CAShapeLayer();
shapeLayerBottom.Frame = cell.Bounds;
shapeLayerBottom.Path = maskPathBottom.CGPath;
//All Corners
var maskPathAll = UIBezierPath.FromRoundedRect(cell.Bounds, UIRectCorner.BottomLeft | UIRectCorner.BottomRight | UIRectCorner.TopLeft | UIRectCorner.TopRight, new CoreGraphics.CGSize(8, 8));
var shapeLayerAll = new CAShapeLayer();
shapeLayerAll.Frame = cell.Bounds;
shapeLayerAll.Path = maskPathAll.CGPath;
if (indexPath.Row == 0 && indexPath.Row == tableView.NumberOfRowsInSection(indexPath.Section) - 1)
{
cell.Layer.Mask = shapeLayerAll;
}
else if (indexPath.Row == 0)
{
cell.Layer.Mask = shapeLayerTop;
}
else if (indexPath.Row == tableView.NumberOfRowsInSection(indexPath.Section) - 1)
{
cell.Layer.Mask = shapeLayerBottom;
}
I've tried this for getting Rounded corners for each section but in this I wasn't able to add shadows to each section . Can anyone suggest in C# since I am beginner to Xamarin iOS. Thanks in advance!