ios – 我如何中风和填充NSAttributedString wUILabel

ios – 我如何中风和填充NSAttributedString wUILabel,第1张

概述是否有可能应用中风填充与NSAttributedString和UILabel? 是的,关键是将一个负值应用到NSStrokeWidthAttributeName 如果这个值是正的,你只会看到笔画,而不是填充。 self.label.attributedText=[[NSAttributedString alloc] initWithString:@"string to both stroke 是否有可能应用中风和填充与NSAttributedString和UILabel?解决方法 是的,关键是将一个负值应用到NSstrokeWIDthAttributename
如果这个值是正的,你只会看到笔画,而不是填充。

@[email protected]=[[NSAttributedString alloc] initWithString:@"string to both stroke and fill" attributes:@{ NSstrokeWIDthAttributename: @-3.0,NSstrokecolorAttributename:[UIcolor yellowcolor],NSForegroundcolorAttributename:[UIcolor redcolor] }];

感谢@cacau下面:另见Technical Q&A QA1531

总结

以上是内存溢出为你收集整理的ios – 我如何中风和填充NSAttributedString w/UILabel全部内容,希望文章能够帮你解决ios – 我如何中风和填充NSAttributedString w/UILabel所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1042536.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存