可能在归属文本背景上有圆角吗?

Jea*_*ler 5 iphone nsattributedstring uilabel ios quartz-core

我将Text归为不同的文本颜色.为了更好地阅读突出显示的文本,我使用backgroundcolor.是否有可能在这个Textarea上带来圆角的CALayer效果?不是整个区域,而是内部的特殊文本.

我的代码:

NSAttributedString *text = [[NSAttributedString alloc] initWithString:@"Highlighted Text"
                                                                          attributes:@{
                                                                                       NSFontAttributeName:            [UIFont fontWithName:@"HelveticaNeue" size:10.0f],
                                                                                       NSForegroundColorAttributeName: [UIColor lightGrayColor],
                                                                                       NSBackgroundColorAttributeName: [UIColor darkGrayColor]
                                                                                       }];
Run Code Online (Sandbox Code Playgroud)