1

I have implemented underline of mutableattributedtext, have set the range also correctly, but it still underlines more than the range specified and instead fills the text box it is contained in.

[attributedString addAttribute:NSUnderlineStyleAttributeName value:[NSNumber numberWithInteger:NSUnderlineStyleSingle] range:NSMakeRange(0,[attributedString length])];

I want this to happen. I want to this type of hyperlink creationBut I receive this as a result of the above code

But Instead I get this.

Community
  • 1
  • 1
anamika41
  • 161
  • 7
  • Problem is your text is multiline and your rang is NSMakeRange(0,[attributedString length] that means to the end of the text. you need to handle line break characters and define your range accordingly. – Imran Oct 09 '15 at 13:37
  • Every word is taken as portionString so attributedString is "ABC" "corporation" etc, so attributedString length gives me individual length of the strings. – anamika41 Oct 09 '15 at 13:44

0 Answers0