I have been using PaintCode to draw some of the graphics within my app, some of the drawn elements have text that is drawn using "drawInRect". The text is always showing up black regardless of what I do to try and set the color.
here is the code where the text is created, and I am attempting to set the color:
//// Rounded Rectangle Drawing
UIBezierPath* roundedRectanglePath = [UIBezierPath bezierPathWithRoundedRect: CGRectMake(0, 0, 66, 66) cornerRadius: 15];
[[NPSColor NPSPrimaryColor] setFill];
[roundedRectanglePath fill];
UIFont *helveticaFont = [UIFont fontWithName:@"AvenirNextCondensed-Bold" size:50];
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
/// Set line break mode
paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;
/// Set text alignment
paragraphStyle.alignment = NSTextAlignmentCenter;
NSDictionary *attributes = @{NSFontAttributeName:helveticaFont,
NSParagraphStyleAttributeName:paragraphStyle};
//// Text Drawing
CGRect textRect = CGRectMake(-4, -2.5, 74, 71.5);
[[NPSColor whiteColor] set];
[textContent drawInRect: CGRectInset(textRect, 0, 6) withAttributes:attributes];
}
The white color in the "text drawing" is what is not working properly. Thanks for the assistance.
NPSColor
"? What happens if you try something like "[[UIColor redColor] set];
" before drawing the text? Does it come out red? – Aromatic