Highlight just the text in a UILabel
问题 I'm attempting to set the background color/highlight just the text within a UILabel . The issue is that the line breaks and spaces added to the UILabel to keep the text centered are also being highlighted. Notice the spacing before the last line in the UILabel is highlighted. Also, the beginning and end of any new lines are also highlighted. I'm creating the example above with the following code: -(void)createSomeLabel { // Create and position my label UILabel *someLabel = [[UILabel alloc]