CustomToolBar

- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx

{

    if([selfisMemberOfClass: [UIToolbarclass]])

    {

        UIImage *image = [UIImage imageNamed:@"微博切tu_65.png"];

        //CGContextClip(ctx);

        CGContextTranslateCTM(ctx, 0, image.size.height);

        CGContextScaleCTM(ctx, 1.0, -1.0);

        CGContextDrawImage(ctx, CGRectMake(0, 0, self.frame.size.width, self.frame.size.height), image.CGImage);

    }

    else

    {

        [super drawLayer:layer inContext:ctx];

    }

}

posted on 2012-11-15 17:56  无量少年  阅读(170)  评论(0编辑  收藏  举报

导航