Is Rounded Corners on Attributed Text Background possible?
Asked Answered
S

0

7

I attributed Text with different textcolors. For better readability on highlighted text i use backgroundcolor. Is it possible to bring the CALayer Effect of Rounded Corners on this Textarea? Not the whole Area but the special Text inside of it.

My Code:

NSAttributedString *text = [[NSAttributedString alloc] initWithString:@"Highlighted Text"
                                                                          attributes:@{
                                                                                       NSFontAttributeName:            [UIFont fontWithName:@"HelveticaNeue" size:10.0f],
                                                                                       NSForegroundColorAttributeName: [UIColor lightGrayColor],
                                                                                       NSBackgroundColorAttributeName: [UIColor darkGrayColor]
                                                                                       }];
Sobriquet answered 2/10, 2013 at 18:30 Comment(2)
possible duplicate of NSAttributedString background color and rounded cornersCerallua
Please check this answer: #21857908Pith

© 2022 - 2024 — McMap. All rights reserved.