tags:

views:

64

answers:

1

Hello all,

I want to add a gradient color to my UILabel or any text on my iPhone screen. I want to know the ways to do it. Both Using interface and programatically.

tnx

A: 

In in the interface, you should be able to select the label and go to inspector (apple + 1) and change the color from there.

Programmatically, use the following property.

UILabel textColor property reference

Example:

[mylabel setTextColor: [UIColor redColor]];

UIColor reference.

To gradient, all you have to do is extend this a little. Break the text that you want to gradient into a group of labels, group them with a list of some sort, and iterate over the grouped labels and apply a textColor. This sort of gradient is trivial and derives immediately from the documentation provided.

Stefan Kendall
I said gradient and not just color.
rkb