我为我的自定义UIButton
创建了CAGradientLayer
。创建它的代码如下:如何将CAGradientLayer旋转180度?
CAGradientLayer *gradient = [CAGradientLayer layer];
gradient.frame = btn.bounds;
gradient.cornerRadius = 10.0f;
locations=[[NSArray alloc] initWithObjects: LOC_0, LOC_5, LOC_51,LOC_1, nil];
[gradient setLocations:locations];
colorNext=[[NSArray alloc] initWithObjects:(id) G3_rgb1, (id) G3_rgb2, (id) G3_rgb3, (id) G3_rgb4, nil];
gradient.colors = colorNext;
[btn.layer insertSublayer:gradient atIndex:0];
我的问题是:在按钮上,我需要180度改变按钮的梯度视图的新闻,我应该怎么办呢?