1、绘制梯形
-(void)drawRect:(CGRect)rect
{
CGRect frameSize = self.frame;
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextMoveToPoint(context, 0, 30);//起始点
CGContextAddLineToPoint (context, frameSize.size.width, 0);//上平行线
CGContextAddLineToPoint (context, frameSize.size.width, frameSize.size.height);//右斜线
CGContextAddLineToPoint (context, 0, frameSize.size.height);//下平行线
CGContextClosePath(context);//收拢, 做成直角梯形
[[UIColor redColor] setFill];
// CGContextSetShadow(context, CGSizeMake(4, 3), 1);
CGContextDrawPath(context, kCGPathFill);
}