iOS-画阴影

    CGContextRef currentContext = UIGraphicsGetCurrentContext();//获取图形上下文状态
    CGContextSaveGState(currentContext);// 将当前图形上下文状态保存至堆栈
    CGContextSetShadow(currentContext, CGSizeMake(4,50), 10);// 设置阴影
    UIImage *logoImage = [UIImage imageNamed:@"icon-10_blue.png"];
    [logoImage drawInRect:rect];
    CGContextRestoreGState(currentContext);// 把堆栈顶部项弹出,返回至之前的图形状态

 

posted on 2015-12-31 14:51  SomeBod_Y  阅读(190)  评论(0编辑  收藏  举报