【发布时间】:2014-09-09 06:11:45
【问题描述】:
【问题讨论】:
【问题讨论】:
有没有办法设置字体加下划线?
不,那只是因为你找错树了。
“字体”不能下划线,(至少,我不这么认为),但字符串可以。
查看 NSAttributedString...您创建了一个“属性”字典,将其附加到您要绘制的 NSString...“倾斜度”、(表示斜体与否)、“居中”...所有这些东西。所以是这样的:
[textAttrDict setObject:[NSNumber numberWithInt:NSUnderlineStyleSingle] forKey:NSUnderlineStyleAttributeName];
[textStr drawInRect:textRect withAttributes:textAttrDict];
在标题中搜索 NSUnderlineStyleSingle 以找到您想要的确切枚举...
【讨论】: