How to prevent CALayer from implicit animations?

后端 未结 7 1573
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 14:59

When I set the backgroundColor property of an CALayer instance, the change seems to be slightly animated. But I don\'t want that in my case. How ca

7条回答
  •  春和景丽
    2020-12-25 15:07

    Try giving your layer a delegate and then have the delegate implement:

    - (id)actionForLayer:(CALayer *)layer forKey:(NSString *)key {
        return [NSNull null];
    }
    

提交回复
热议问题