我一直试图找出一种绘制线段的方法,如下图所示:

我想:
我一直试图用CGContextAddArc类似的电话来做这件事,但没有走得太远.
有人可以帮忙吗?
到目前为止我有这个代码:
CGPoint midLeft = CGPointMake(0, additionalHeight);
CGPoint bottomCenter = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height);
CGPoint midRight = CGPointMake(self.bounds.size.width, additionalHeight);
CGPoint topRight = CGPointMake(self.bounds.size.width, 0);
CGPoint topLeft = CGPointMake(0, 0);
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context, midLeft.x, midLeft.y);
CGContextAddLineToPoint(context, midRight.x, midRight.y);
CGContextAddLineToPoint(context, topRight.x, topRight.y);
CGContextAddLineToPoint(context, topLeft.x, topLeft.y);
CGContextClosePath(context);
Run Code Online (Sandbox Code Playgroud)
现在,它只是画了一个矩形,但我希望它能画出一个弧线,它向下延伸到bottomCenter,就像这个图像顶部的形状:

我已经尝试了CGContextAddArc和AddArcToPoint,并按照教程,但我无法弄清楚如何绘制这种弧.任何帮助表示赞赏.