【发布时间】:2015-12-21 17:56:42
【问题描述】:
我使用 Xamarin 绑定 https://github.com/TTTAttributedLabel/TTTAttributedLabel
并且根据 - Make link in UILabel.attributedText *not* blue and *not* underlined
self.label.linkAttributes = @{NSForegroundColorAttributeName: color,
NSUnderlineStyleAttributeName: @(NSUnderlineStyleNone)};
我想设置我的链接属性,我只是不确定语法 -
我已经尝试过这些变化 -
label.LinkAttributes = new NSDictionary(
new NSString("NSForegroundColorAttributeName"), UIColor.Red,
new NSString("NSUnderlineStyleAttributeName"), new NSUnderlineStyle() == NSUnderlineStyle.Double);
label.LinkAttributes = new NSDictionary(
new NSString("NSForegroundColorAttributeName"), UIColor.Red,
new NSString("NSUnderlineStyleAttributeName"), new NSNumber(2));
但不工作。不确定如何传入 UIColor,因为它看不到它的可用类型,它正在做“某事”,因为它用这段代码擦除了我的下划线 + 蓝色。
【问题讨论】:
标签: xamarin xamarin.ios uicolor tttattributedlabel