工作生活

UIButton的title添加下划线

2019-07-03  本文已影响0人  阿姣_0405
        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)
上一篇 下一篇

猜你喜欢

热点阅读