CAGradientLayer animation flickers when changing number of color stops
| Originator: | tternes | ||
| Number: | rdar://21808722 | Date Originated: | 14-Jul-2015 12:26 AM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 9.0 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: CAGradientLayer automatically animates changes to the gradient specified in its .color property (an array of CGColorRef objects). As long as the number of stops in the array is always the same, the animation is performed smoothly. However, changing the number of color stops causes the animation to behave erratically. Steps to Reproduce: See included sample project for a working example. 1. Create a CAGradientLayer instance and add it to a view’s layer 2. Assign an array of colors to the gradient layer’s colors property 3. Assign a different array of colors (with an equal number of stops as the first) to the gradient layer. Observe a smooth transition between the two gradients. 4. Assign another array of colors to the layer’s color property. This time, use one with a different number of stops. In the example project, this step causes the layer to flash the final gradient, instead of animating smoothly. Expected Results: Animation of the gradient changes should happen smoothly, regardless of the number of color stops. Actual Results: Gradient animations may flicker or flash depending on the number of incoming and outgoing gradient color stops. Regression: From my testing, this has been happening on all of the iOS 9.0 betas. I haven’t attempted regression testing on 8.x and earlier versions. Notes: Please see attached project for a demonstration of the issue.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!