samedi 27 juin 2015

iOS and unicode characters: \u+2605 not solid star in UILabel

I'm trying to make a UILabel that says "★ FEATURED". However, when it renders it, the star isn't solid! Here's the code I'm using:

    _sponsoredLabel = [UILabel new];
    _sponsoredLabel.numberOfLines = 1;
    _sponsoredLabel.lineBreakMode = NSLineBreakByTruncatingTail;
    _sponsoredLabel.textColor = [UIColor yellowColor];
    _sponsoredLabel.backgroundColor = [UIColor clearColor];
    _sponsoredLabel.textAlignment = NSTextAlignmentLeft;
    _sponsoredLabel.text = @"✭ FEATURED";
    _sponsoredLabel.font = [UIFont fontWithName:@"HelveticaNeue-Light" size:14.0f];
    _sponsoredLabel.hidden = YES;

In the text itself it looks solid, but here's what it looks like when it renders:

Any advice is much appreciated!

Aucun commentaire:

Enregistrer un commentaire