It's driving me crazy! I am working on a drawing application. Let's say I am working on a UIView
called sheet.
I am adding some sublayers to this view ([sheet.layer addSublayer:...]
) and then I want to draw into them. To do so I am creating a CGImageRef
and putting it into the layer's contents
. But it's animated and I don't want that.
I tried everything:
removeAnimationForKey:
removeAllAnimations
delegate
[CATransaction setDisableAnimations:YES]
It's seems correct. I don't understand why this layer is still animated ;_;
Am I doing something wrong? Is there a secret way?
Overview. Layers are often used to provide the backing store for views but can also be used without a view to display content. A layer's main job is to manage the visual content that you provide but the layer itself has visual attributes that can be set, such as a background color, border, and shadow.
Swift
CATransaction.begin() CATransaction.setDisableActions(true) // change layer properties that you don't want to animate CATransaction.commit()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With