iOS textfield设置字符间距

添加富文本属性:

NSDictionary *attrsDictionary =@{
                    NSFontAttributeName: self.textField.font,
                    NSKernAttributeName:[NSNumber numberWithFloat:10.0f]//这里修改字符间距
                    };
self.textField.attributedText=[[NSAttributedString alloc]initWithString:text attributes:attrsDictionary];

 

posted @ 2017-03-20 18:36  听风gcl  阅读(2949)  评论(0编辑  收藏  举报