2

I'm using...

NSArray *colors = [NSArray arrayWithObjects:(id) colorOne.CGColor, colorTwo.CGColor, nil];
CAGradientLayer *headerLayer = [CAGradientLayer layer];
headerLayer.colors = colors;
headerLayer.frame = self.button_editEntry.bounds;
[headerLayer setCornerRadius:10];
[self.button_editEntry.layer insertSublayer:headerLayer
                                    atIndex:0];

... to get a linear fill happening on my button. The problem is when I animate the frame size (using UIView beginAnimations) the CAGradientLayer disappears and doesn't animate with the rest of the frame. Is there a reason this isn't working?

Is there a better way to do linear fades?

Mehul Mistri
  • 15,037
  • 14
  • 70
  • 94
Mike S
  • 4,092
  • 5
  • 35
  • 68
  • Related: http://stackoverflow.com/questions/9381077/cagradientlayer-properties-not-animating-within-uiview-animation-block?rq=1 – jrturton Aug 14 '12 at 07:35
  • possible duplicate of [CAGradientLayer not autoresizing](http://stackoverflow.com/questions/10940606/cagradientlayer-not-autoresizing) – jrturton Aug 14 '12 at 07:36
  • Can i do a concurrent CATransition and UIView animation? – Mike S Aug 14 '12 at 10:57

0 Answers0