I have a UILabel
with textColor
set to white. However, the truncation at the end of the label is still black.
I don't have reputation to post image so here is a link. Sorry in advance if the link doesn't work.
I am using UICollectionView
and the text is UILabel
, here is my code for the label:
UILabel *nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(8.0f, 4.0f, 135.0f, 36.0f)];
nameLabel.numberOfLines = 2;
nameLabel.lineBreakMode = NSLineBreakByTruncatingTail;
nameLabel.text = _name;
nameLabel.font = [UIFont fontWithName:@"STHeitiSC-Medium" size:15.0f];
[nameLabel sizeToFit];
nameLabel.textColor = [UIColor whiteColor];
[purpleMask addSubview:nameLabel];
Has anyone ran into this kind of issue?
add something like this:
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"Presenting the great..."];
[string addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(24, 11)];
nameLabel.attributedText = string;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With