over 7 years ago
Hi all,
if you want to give inter letter spacing to any kind of text of button , label , textfields etc then you can follow this code.
First make attributed string :-
NSMutableAttributedString * title = [[NSMutableAttributedString alloc] initWithString:@"this is sample code to text this example"]; [title addAttribute:NSForegroundColorAttributeName value:[UIColor lightGrayColor] range:NSMakeRange(0,22)]; [title addAttribute:NSForegroundColorAttributeName value:[UIColor darkGrayColor] range:NSMakeRange(22,18)]; [title addAttribute:NSKernAttributeName value:@(2.0) range:NSMakeRange(0,title.length)];
Now, assign attributed string to any object for example :-
//For UILabel self.label.attributedText = title; //For UIButton [self.button setAttributedTitle:title forState:UIControlStateNormal]; //for UITextField self.textField.attributedText = title;
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)