jjzjj

attributedDiscunt

全部标签

ios - NSMutableAttributedString 在具有特定范围的 tableviewcell 中不起作用

我关注了thisquestion但没有解决我的问题。我在ViewController中有一个tableview,tableviewcell有一个标签。我想用NSStrikethroughStyleAttributeName设置attributedString。如果我将完整的字符串设置为删除线,它会起作用但是如果我设置为部分字符串,它就不起作用。BelowcodeforsuccessresultletstrOriginalPrice="myprice"letstrdiscountedPrice="discountedprice"letstrPrice=strOriginalPrice+"