What you are looking for is CAGradientLayer
. Every UIView
has a layer - into that layer you can add sublayers, just as you can add subviews. One specific type is the CAGradientLayer
, where you give it an array of colors to gradiate between.
One example is this simple wrapper for a gradient view:
http://oleb.net/blog/2010/04/obgradientview-a-simple-uiview-wrapper-for-cagradientlayer/
Note that you need to include the QuartZCore framework in order to access all of the layer parts of a UIView.