Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
664 views
in Technique[技术] by (71.8m points)

iphone - Will sending -removeAllAnimations to a layer also propagate to all it's sublayers?

I wonder if sublayer animations would continue to play if I send -removeAllAnimations to a parent layer.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As per the documentation for removeAllAnimations:

Remove all animations attached to the receiver.

You'll need to iterate through the sublayers and remove animations from them as well:

for (CALayer* layer in [containerLayer sublayers]) {
  [layer removeAllAnimations];
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...