Return to Snippet

Revision: 43037
at March 15, 2011 18:17 by zamza726


Updated Code
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
        NSString * data_title = @"Sample";

	UIGraphicsPushContext(ctx);
         .....
	UIFont *font = [UIFont boldSystemFontOfSize:13];
	CGSize titletextSize = [data_title sizeWithFont:font];
	textPoint.x = 0.8f * (CGRectGetWidth(layer.bounds) - titletextSize.width);
	CGContextDrawPath(ctx, kCGPathFill);
	[subject drawAtPoint:titlePoint withFont:font];
 	UIGraphicsPopContext();

}

Revision: 43036
at March 15, 2011 18:14 by zamza726


Initial Code
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx {
        NSString * data_title = @"Sample";

         .....
	UIFont *font = [UIFont boldSystemFontOfSize:13];
	CGSize titletextSize = [data_title sizeWithFont:font];
	textPoint.x = 0.8f * (CGRectGetWidth(layer.bounds) - titletextSize.width);
	CGContextDrawPath(ctx, kCGPathFill);
	[subject drawAtPoint:titlePoint withFont:font];
 	UIGraphicsPopContext();

}

Initial URL


Initial Description
Used in MyTTable

Initial Title
DrawText in CALayer

Initial Tags


Initial Language
Objective C