Alex Rivera | Logout

Make Background of UIView a Gradient Without Sub Classing

Asked 2009-05-10T04:55:27.383
27

Is there a way to make the background of a UIView a gradient without subclassing it? I'd rather not use an image file to accomplish this either. It just seems obtuse to have to subclass UIView just to draw a gradient for the background.

Edit
Report

1 Answer

1

I agree with rpetrich, it would be cleaner to just do the UIView subclass. For an example of how to do this, see my response in this question. If you wanted, you could create a generic gradient UIView subclass and simply place that behind the views you want to have gradient backgrounds.

answered 2009-05-10T14:45:42.630

Your Answer