The dotted line at the end of an UILabel is not affected by the textColor.
You will find a sample project here : https://github.com/nverinaud/DottedLineBug.
The code involved is the following :
- (IBAction)sliderValueChanged:(UISlider *)sender
{
UIColor *color = [UIColor colorWithHue:sender.value
saturation:1
brightness:1
alpha:1];
self.label.textColor = color;
}
Here is a picture showing the issue :
Does anyone have the same bug and have find a workaround ?
Thanks !
Using NSAttributedString
does work. (Thanks to Andrea).
Here is an exemple :
- (IBAction)sliderValueChanged:(UISlider *)sender
{
UIColor *color = [UIColor colorWithHue:sender.value
saturation:1
brightness:1
alpha:1];
NSAttributedString *text = [[NSAttributedString alloc] initWithString:self.text attributes:@{ NSForegroundColorAttributeName : color }];
self.label.attributedText = text;
}
I did report to Apple, here is the report ID : 16470528
.
It has already been marked by Apple as a duplicate of 16443091
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With