版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_28285625/article/details/82048932
- 设置button的下划线直接设置文字的属性
NSMutableAttributedString
的abStr添加文字属性NSUnderlineStyleAttributeName
并设置下划线样式,NSUnderlineStyleNone
-- 无下划线,NSUnderlineStyleSingle
-- 单行下划线,NSUnderlineStyleThick
-- 单行加粗下划线,NSUnderlineStyleDouble
-- 双下划线. - 设置下划线颜色属性
NSUnderlineColorAttributeName
- 最主要的是设置button的标题为
NSMutableAttributedString
包含多种属性的字符串string.