相关疑难解决方法(0)

使用Swift将删除线添加到iOS 11中的NSAttributedString

遇到一些删除线才能正常工作的问题。目前,我正在执行以下操作:

theString.addAttributes([
        NSAttributedStringKey.strikethroughStyle: NSUnderlineStyle.styleSingle.rawValue, 
        NSAttributedStringKey.strikethroughColor: UIColor.white
    ], range: NSMakeRange(0, 1))
Run Code Online (Sandbox Code Playgroud)

它没有显示任何形式的删除线。有任何想法吗?我似乎找不到任何有效的方法。

nsattributedstring strikethrough ios swift

2
推荐指数
3
解决办法
2821
查看次数

标签 统计

ios ×1

nsattributedstring ×1

strikethrough ×1

swift ×1