Cagradientlayer believe that we are more familiar with the use of it, I am not here nonsense, there are many online introduction, want to learn more about the words, you can go to see. I simply say how to use cagradientlayer to make screen unlock text animation effect.
1, create a Cagradientlayer object Gradlayer, set its frame and label.bounds the same (note here is the label of the bounds is not a frame);
2, here I give gradlayer.colors set up a total of three color values, the first color transparency set to 0.3, the middle of the color value of the transparency of the default 1.0, and then as a label mask, so that looks the effect is: the color of the end of the dark, the middle color is bright;
3, Cagradientlayer has a property locations can set the color gradient point (range is 0.0~1.0), the second color value of the gradient point set to 0.0, the animation to set it to 1.0, it will achieve the desired effect.
Demo Address: Https://github.com/Tbwas/UnlockAnimation
Wen/Xin Dong Re (author of Jane book)
Original link: http://www.jianshu.com/p/0984d67c632e
Copyright belongs to the author, reproduced please contact the author to obtain authorization, and labeled "Jane book author."
The above is the IOS screen unlock text animation effect of the implementation, there is a need for small partners can refer to, thank you all for the support of this site!