gpt4 book ai didi

ios - 如何在更改 UIView 的转换属性时禁用动画?

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:17:35 26 4
gpt4 key购买 nike

正如苹果文档所说:'转换指定应用于接收器的转换,相对于其边界的中心。

@property(nonatomic) CGAffineTransform transform

Discussion The origin of the transform is the value of the center property, or the layer’s anchorPoint property if it was changed. (Use the layer property to get the underlying Core Animation layer object.) The default value is CGAffineTransformIdentity.

Changes to this property can be animated. Use the beginAnimations:context: class method to begin and the commitAnimations class method to end an animation block. The default is whatever the center value is (or anchor point if changed)'

我不需要动画,如何在更改 UIView 的 transform 属性时禁用动画?

最佳答案

您可以通过这种方式禁用隐式动画:

[CATransaction begin];
[CATransaction setDisableActions:YES];
// or if you prefer: [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
// Your code here for which to disable the implicit animations.
[CATransaction commit];

https://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CATransaction_class/Introduction/Introduction.html

关于ios - 如何在更改 UIView 的转换属性时禁用动画?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18639046/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com