2

Apple recently released iOS 10.3 version, before the use of NSMutableAttributedString set the strikers do not show the

    [attributedString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlineStyleSingle | NSUnderlinePatternSolid) range:NSMakeRange(length1 + 7, length2 + 5)];

Tried a lot of ways are not resolved, hoping to get everyone's help

Vinod Kumar
  • 3,375
  • 1
  • 17
  • 35
chenbo
  • 83
  • 4
  • see this http://stackoverflow.com/questions/43070335/nsstrikethroughstyleattributename-how-to-strike-out-the-string-in-ios-10-3 – Anbu.Karthik Apr 05 '17 at 07:06
  • Its open bug in iOS 10.3 Here, its open radar link: http://www.openradar.appspot.com/31034683 – MilanPanchal Apr 05 '17 at 09:32
  • Fixed in 10.3.2 beta 2 – EricLaw Apr 13 '17 at 17:40
  • Possible duplicate of [NSStrikethroughStyleAttributeName , How to strike out the string in iOS 10.3?](https://stackoverflow.com/questions/43070335/nsstrikethroughstyleattributename-how-to-strike-out-the-string-in-ios-10-3) – Larme May 31 '17 at 06:31

1 Answers1

5

iOS 10.3 onward you should have to add one more attribute.

[attributedString addAttribute:NSBaselineOffsetAttributeName value:@0 range:NSMakeRange(length1 + 7, length2 + 5)];

[attributedString addAttribute:NSStrikethroughStyleAttributeName value:@(NSUnderlineStyleSingle | NSUnderlinePatternSolid) range:NSMakeRange(length1 + 7, length2 + 5)];
Piyush
  • 1,156
  • 12
  • 20