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]
                                                                                       }];
hpique
  • 119,096
  • 131
  • 338
  • 476
Jeanette Müller
  • 999
  • 1
  • 11
  • 19
  • 1
    possible duplicate of [NSAttributedString background color and rounded corners](http://stackoverflow.com/questions/16362407/nsattributedstring-background-color-and-rounded-corners) – bbarnhart Jan 30 '14 at 13:56
  • 2
    Please check this answer: http://stackoverflow.com/questions/21857408/how-to-set-nsstrings-background-cornerradius-on-ios7 – neowinston Dec 02 '14 at 21:38

0 Answers0