I want to set NSString\'s background cornerRadius on iOS7. But,NSString don\'t have layer...
Please tell me, how to set NSString\'s background cornerRadius on iOS7?<
An NSString
just defines a string of text. It doesn't define the properties of how it is rendered. For showing text on the screen, usually a UILabel
or UITextView
is used. However, for the selection behavior that you're showing in your example, you'll need to do that drawing yourself. Also it is changing the text color of the selected text, so you'll need to handle doing that yourself.
If you created a custom UIView
that allows you to draw the blue selection area, you could place that behind a UILabel
, and you could use an NSAttributedString
to set the text of the label where the "selected" text is white instead of black. That would probably be the simplest way to do this.