iOS - 禁用或编辑 CATextLayer 的动画

标签 ios xcode catextlayer

我使用 CATextLayer var,当尝试增加字体或在此字符串中键入内容时,这些操作会产生动画效果,如何编辑或禁用 CATextLayer 的动画?

最佳答案

您可以通过在层上设置 Action 字典以返回 [NSNull null] 作为适当键的动画来实现此目的。例如:

   NSDictionary *newActions = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"contents", nil];
    normalTextLayer_.actions = newActions;
    [newActions release];

o 禁用淡入/淡出动画我相信 contents 键就是您要找的那个

关于iOS - 禁用或编辑 CATextLayer 的动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7546906/

相关文章:

ios - swift : How can i obtain a documented value for UIImagePickerControllerMediaType

ios - 如何通过 prepareForSegue : an object

iOS - 动画上显示的文本

ios - 在 AVMutableVideoComposition 中创建一个按时间间隔更改的 CATextlayer

ios - 如何以编程方式获取 iOS 的字母数字版本字符串

ios - 获取 PFObject 的用户名

ios - Xcode 6 进程启动失败 : timed out trying to launch app

iphone - 缺少基础 SDK?

objective-c - 升级到 Xcode 5.0.2 : xib warning. 属性不可用

ios - 添加 TextView 作为图像的子层 ios swift