Search code examples
iosuitextviewnsmutableattributedstring

text underline a different color than the text color in iOS


I'm currently using a UITextView and setting its attributedText property, but I can't see a way to set the underline color different from the text color using my NSMutableAttributedString. Am I just missing something? Is this possible?

Do I need to look into CoreText? Is it possible there?


Solution

  • You can set two UITextViews with the same text and different colors on top of each other, with the textview underneath underlined.