Я пытаюсь добавить CATextLayer
в UITableViewCell
. Проблема в том, что текст рендерится как черный, а я уже установил его foregroundColor. Может ли кто-нибудь сказать мне, что мне не хватает? Благодарю.CATextLayer textcolor всегда черный
CATextLayer *buyPrice_port = [CATextLayer layer];
buyPrice_port.frame = CGRectMake(144, 42, 76, 21);
buyPrice_port.font = (__bridge CFTypeRef)([UIFont boldSystemFontOfSize:18]);
buyPrice_port.foregroundColor = [UIColor colorWithRed:0 green:190/255.0 blue:191/255.0 alpha:1.0].CGColor;
buyPrice_port.alignmentMode = kCAAlignmentCenter;
buyPrice_port.string = @"BAC";
[self.contentView.layer addSublayer:buyPrice_port];
Смотрите также [Как изменить цвет текста в CATextLayer в Swift] (HTTP: //stackoverflow.com/questions/38835130/how-to-change-the-text-color-in-a-catextlayer-in-swift) – Suragch