[[UIColor blackColor] setFill]; doesn't do anything


#1

Kindle location: 3845

[code] NSString *text = @“You are getting sleepy”;
UIFont *font = [UIFont boldSystemFontOfSize:28];

CGRect textRect;
textRect.size = [text sizeWithFont:font];
textRect.origin.x = center.x - textRect.size.width / 2.0;
textRect.origin.y = center.y - textRect.size.height /2.0;

/******WHAT IS THIS LINE SUPPOSED TO DO******/
[[UIColor blackColor] setFill];

/*********************************************************/

CGSize offset = CGSizeMake(4, 3);
CGColorRef color = [[UIColor darkGrayColor] CGColor];
CGContextSetShadowWithColor(ctx, offset, 2.0, color);

[text drawInRect:textRect withFont:font];[/code]

#2

You are setting the fill color but not applying it.

You should apply it after setting the fill color:

[[UIBezierPath bezierPathWithRect:[self bounds]] fill];

#3

[quote=“ibex10”][quote]
/WHAT IS THIS LINE SUPPOSED TO DO/
[[UIColor blackColor] setFill];
/*********************************************************/
[/quote]
You are setting the fill color but not applying it.

You should apply it after setting the fill color:

[[UIBezierPath bezierPathWithRect:[self bounds]] fill]; [/quote]

ok. well i didnt see this in the book(kindle version). I went back and just checked again…