Font With Strike through it

后端 未结 5 924
执念已碎
执念已碎 2020-12-16 08:15

I am doing one project of handling task of the day like taking notes.
So I assign daily task to do and when task is done I want one line strike through the task name.

5条回答
  •  我在风中等你
    2020-12-16 08:43

    In Swift,

    let label = UITextView(frame: CGRectMake(0, 0, 300, 100))
    let strikeThroughAttributes = [NSStrikethroughStyleAttributeName: NSUnderlineStyle.StyleSingle.rawValue]
    let labelString = NSAttributedString(string: "Hello, playground", attributes: strikeThroughAttributes)
    label.attributedText = labelString
    

提交回复
热议问题