Osc*_*uch 3 uilabel ios ios7 textkit letterpress
在WWDC 2013视频中,他们表明开发人员可以对文本使用凸版印刷效果.有没有人有任何示例代码如何使用UILabel执行此操作/如何执行此操作?
Ami*_*mit 17
他们现在变得非常简单.
//Use any font you want or skip defining it
UIFont* font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
//Use any color you want or skip defining it
UIColor* textColor = [UIColor blueColor];
NSDictionary *attrs = @{ NSForegroundColorAttributeName : textColor,
NSFontAttributeName : font,
NSTextEffectAttributeName : NSTextEffectLetterpressStyle};
NSAttributedString* attrString = [[NSAttributedString alloc]
initWithString:note.title
attributes:attrs];
myTextLabel.attributedText = attrString;
Run Code Online (Sandbox Code Playgroud)