美文网首页工作生活
UIButton的title添加下划线

UIButton的title添加下划线

作者: 阿姣_0405 | 来源:发表于2019-07-03 17:02 被阅读0次
        let service_agreement = "iqiyi_service_agreement".localizable()
        let serviceAttriStr = NSMutableAttributedString(string:"")
        let serviceAttrs = [NSAttributedString.Key.font : UIFont.systemFont(ofSize:40.0), NSAttributedString.Key.foregroundColor :UIColor.red,NSAttributedString.Key.underlineStyle :1] as [NSAttributedString.Key : Any]
        let serviceStr = NSMutableAttributedString.init(string: service_agreement, attributes: serviceAttrs)
        serviceAttriStr.append(serviceStr)
        qiyiServericeBtn.setAttributedTitle(serviceAttriStr, for: .normal)

相关文章

网友评论

    本文标题:UIButton的title添加下划线

    本文链接:https://www.haomeiwen.com/subject/lmwzcctx.html