我有一个textview,其中包含文本和一些项目列表。我想以黑色显示文本,以橙色显示项目符号。怎么做。?
提前致谢。

最佳答案

迅速3.1

  let  DelevieryDateString = "●" + "This is a list item!"

    let DelevieryDateStr: NSMutableAttributedString =  NSMutableAttributedString(string: DelevieryDateString)

    DelevieryDateStr.addAttribute(NSForegroundColorAttributeName,
                                    value: UIColor.green, //color code what you want
                                    range: NSRange(
                                        location:0, // Find the location of the bullet and replace it
                                        length: 1))
lblitem.attributedText = DelevieryDateStr

09-25 17:59