绘制图形-移动,旋转,阴影,渐变

// Only override drawRect: if you perform custom drawing.

// An empty implementation adversely affects performance during animation.

- (void)drawRect:(CGRect)rect {

    UIBezierPath *path = [UIBezierPath bezierPath];

    //画图的起点坐标

    [path moveToPoint:CGPointMake(50, 50)];

    //依次连接各个坐标

    [path addLineToPoint:CGPointMake(50, 100)];

    [path addLineToPoint:CGPointMake(100, 100)];

    [path addLineToPoint:CGPointMake(100, 50)];

    //闭合

    [path closePath];

    //上下文

    CGContextRef context = UIGraphicsGetCurrentContext();

    //保存上下文状态

    CGContextSaveGState(context);</

posted @ 2017-05-06 15:48  wzjhoutai  阅读(127)  评论(0)    收藏  举报