'NSAttributed string for UISegmentedControl
I'm trying to set custom spacing to my UISegmented Control. How can I define the NSKernAttributeName and value attribute to define custom spacing between the letters?
[myUIControl setTitleTextAttributes:@{ NSForegroundColorAttributeName : [UIColor whiteColor], NSFontAttributeName: [UIFont fontWithName:myFont size:13]} forState:UIControlStateSelected];
This is how it is done for a UIButton
[attributedString addAttribute:NSKernAttributeName
value:@(dinSpacing)
range:NSMakeRange(0, [myString length])];
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
