Reputation: 17586
I would like to use a an image as the color of an letter-pressed label but something is not working right and I am not sure what. I create the color with
UIImage *redImage = [UIImage imageNamed:@"Red"];
UIColor *redColor = [UIColor colorWithPatternImage:scaledRedImage];
When I create the attributes
NSDictionary *attributes = @{NSForegroundColorAttributeName : redColor, NSTextEffectAttributeName : NSTextEffectLetterpressStyle};
the label is letter-pressed but the color is white.
When using NSDictionary *attributes = @{NSForegroundColorAttributeName : redColor};
, the color is set correctly so I know that the color is created correctly.
NSDictionary *attributes = @{NSForegroundColorAttributeName : [UIColor redColor], NSTextEffectAttributeName : NSTextEffectLetterpressStyle};
works perfectly.
So to sum up:
Why is this happening and how can I fix it?
Upvotes: 2
Views: 273