UILabel letters break

enter image description here I am trying to use a special character in UILabel. But he cuts the labels. I set a red background to show where the edge of the label is. Any reason why this could happen? I have maskToBounds and clipToBounds for NO;

CGSize lblSize = [FontHelper sizeForText:text withFont:[self getBodyFont] withWidth:kColumnWidth andNumberOfLines:1000]; UILabel*lbl = [[UILabel alloc] initWithFrame:CGRectMake(x, y + body.frame.size.height - columnHeight - kBottomMargin, kColumnWidth, lblSize.height)]; lbl.clipsToBounds = NO; lbl.layer.masksToBounds = NO; lbl.text = text; lbl.backgroundColor = [UIColor redColor]; lbl.font = [self getBodyFont]; lbl.textColor = [UIColor blackColor]; lbl.numberOfLines = 0; lbl.textAlignment = UITextAlignmentLeft; lbl.lineBreakMode = UILineBreakModeWordWrap; 
+4
source share
2 answers

I think I found a solution. The client provided me the above text in a Word Doc, and I had a copy and paste into a file. The space between the point and the text turned out to be space, but was another special symbol. So copy / paste flared up with his ugly head.

+1
source

For everyone who stumbles about this question, I had the same problem, and in my case there were several tabs in UILabel, which caused the same effect.

+1
source

All Articles