iOS实现渐变背景色的三种方法

     In some particular circumstances, we want to use a gradient background view. As far as my knowledge can reach, there are three different ways to implement a gradient background: CAGradientLayer, CGGradient and CoreImage.
     First, Let’s have a look at the result.
iOS实现渐变背景色的三种方法_第1张图片
     To define the gradient colour, we have at least four properties:
    @property (nonatomic) CGPoint inputPoint0;
    @property (nonatomic) CGPoint inputPoint1;
    @property (nonatomic) UIColor *inputColor0;
    @property (nonatomic) UIColor *inputColor1;

     The two CGPoint properties define where the gradient colour begins and ends. They are defined in a unit coordinate space where (0, 0) at the top left and (1, 1) at the bottom right. T

你可能感兴趣的:(iOS开发,iOS,渐变背景色,UIView,background)