How to increase the character spacing in UILabel

后端 未结 6 735
孤独总比滥情好
孤独总比滥情好 2020-12-23 21:23

I am creating an app in >=iOS6. And I want to change the character spacing in UILabel. I have added the custom font \"FUTURABT HEAVY\" in my app but the Character are too cl

6条回答
  •  时光取名叫无心
    2020-12-23 21:45

       NSString *strDigit= @"001";
       NSString *strCrushImpact =[NSStringstringWithFormat:@"%d",[strDigit intValue]];
    
           // Set space in between character
       float spacing = 3.0f;
    
       NSMutableAttributedString *attributedStrDigit = [[NSMutableAttributedString alloc] initWithString:strWin];
       [strCrushImpact addAttribute:NSKernAttributeName value:@(spacing)
                 range:NSMakeRange(0, [strDigit length])];
     label.attributedText = attributedStrDigit;
    

提交回复
热议问题