I\'m adding a CAGradientLayer to a view. When the view is auto-resized (such as after a rotation) the gradient layer is not resized. Can the gradient be set to auto
CAGradientLayer
I resize the layer's bounds manually by overriding the setFrame: method of the view:
setFrame:
-(void)setFrame:(CGRect)frame { [super setFrame:frame]; _gradientLayer.bounds = CGRectMake(0, 0, CGRectGetWidth(frame), CGRectGetHeight(frame)); }