首页 > 其他 > 详细

UILabel调整字间距

时间:2015-06-09 09:51:21      阅读:117      评论:0      收藏:0      [点我收藏+]

1、引入

 技术分享

在文件导入

#import <CoreText/CoreText.h>


2、程序

   

NSMutableAttributedString *attributedString =[[NSMutableAttributedString alloc]initWithString:@"你的字符串"];
    long number = 5.0f;//间距
    CFNumberRef num = CFNumberCreate(kCFAllocatorDefault,kCFNumberSInt8Type,&number);
    [attributedString addAttribute:(id)kCTKernAttributeName value:(__bridge id)num range:NSMakeRange(0,[attributedString length])];
    CFRelease(num);
     [ColumnIntroduce setAttributedText:attributedString];

UILabel调整字间距

原文:http://blog.csdn.net/tch8502/article/details/46422405

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!