Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to change the text color of a label by using RGB values without changing the background colour?

xCode interface builder:

When I try to change the color property of a label's text by using the RGB values, the background color also changes to the same value automatically.

in other words:

While setting the RGB values for text colour of labels, the background colour also changes unless we use the sliders.


How to make sure that only the color of text changes and not the background?

iPad, iOS 6

Posted on Feb 14, 2013 11:50 PM

Reply
Question marked as Best reply

Posted on Feb 21, 2013 10:21 PM

You can simply do this.


[labelname setTextColor:[UIColor colorWithRed:38/255.0f green:171/255.0f blue:226/255.0f alpha:1.0f]];

1 reply

How to change the text color of a label by using RGB values without changing the background colour?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.