Tag: 笔画

在UILabel子类中概述UILabel文本

我正在努力寻找一种方法来简单地为我的UILabel文本添加一个大纲/描边/轮廓。 谈论围绕文字的字母而不是UILabel的背景。 我正在使用swift 3,我想直接将我的文本概述到我的子类:UILabel。 我find了多个答案,build议这样做的事情: let strokeTextAttributes = [ NSStrokeColorAttributeName : UIColor.black, NSForegroundColorAttributeName : UIColor.white, NSStrokeWidthAttributeName : -4.0, NSFontAttributeName : UIFont.boldSystemFont(ofSize: 30) ] self.attributedText = NSMutableAttributedString(string: self.text!, attributes: strokeTextAttributes) 但事情是,它不工作。 我的文字仍然是一样的没有轮廓… 有人可以帮我吗? 这将是一件伟大的事情:) 非常感谢。 干杯。