我正在使用UITextView
,我想更改我在此组件中使用的超链接的颜色.例如,如果UITextView
显示www.gmail.com,则显示为蓝色.我想改变那种颜色.
Tim*_*own 118
好哇!Apple已经发布了适用于iOS7的解决方案!如本答案中所述,您可以使用a的linkTextAttributes
属性UITextView
.带下划线的白色链接看起来像这样:
yourTextView.linkTextAttributes = @{
NSForegroundColorAttributeName: [UIColor whiteColor],
NSUnderlineStyleAttributeName: [NSNumber numberWithInt:NSUnderlineStyleSingle]
};
Run Code Online (Sandbox Code Playgroud)
或者您也可以更改tintColor
,因为UITextView
继承UIView
并使用tintColor
属性来着色链接 - 请参阅:
yourTextView.tintColor = [UIColor whiteColor];
Run Code Online (Sandbox Code Playgroud)
现在您的链接看起来很史诗!
归档时间: |
|
查看次数: |
21342 次 |
最近记录: |