molon / MLLabel

UILabel replacement with TextKit. Support link and expression.
MIT License
723 stars 115 forks source link

在Swift中使用MLLinkLabel问题 #62

Closed yansun2006 closed 7 years ago

yansun2006 commented 7 years ago

在Swift中使用MLLinkLabel的时候,设置linkTextAttributes的换行模式,会不显示链接的文本 let textLabel = MLLinkLabel() textLabel.linkTextAttributes = [NSUnderlineStyleAttributeName: NSUnderlineStyle.styleSingle]

但是直接使用Int类型就可以,如下: textLabel.linkTextAttributes = [NSUnderlineStyleAttributeName:1]

molon commented 7 years ago

抱歉,不怎么懂swift~

linbo8303 commented 7 years ago

textLabel.linkTextAttributes = [NSUnderlineStyleAttributeName: NSUnderlineStyle.styleSingle.rawValue]

yansun2006 commented 7 years ago

感谢 @linbo8303