J'ai créé un CAGradientLayer
pour mon UIButton
s. Le code pour la création est comme suit:Comment faire pivoter un CAGradientLayer de 180 degrés?
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];
Ma question est: sur la presse du bouton que je dois changer la vue gradient du bouton de 180 degrés, comment dois-je faire?