Hi there,
I wanted to make a UILabel with a gradient as its text color, and its fairly easy doing it like this:
let gradientImage = ... // Create a Gradient image using CAGradientLayer
label.textColor = UIColor(patternImage: gradientImage)
Problem is that as soon as I set this pattern image color, the UILabel is not accessible anymore. So isAccessibilityElement
is set to false
and I have no way of changing this back. The issue doesn't lie in the gradientImage
, as using any other image as the patternImage
for the textColor
results in the same issue. Did anyone else experience this before and knows a way around this?
Thanks, Klemens