zoukankan      html  css  js  c++  java
  • CALayer创建和和如何隐藏隐式动画

    //修改CALay属性会产生隐式动画

    - (void)viewDidLoad { [super viewDidLoad]; // 创建图层 CALayer *layer = [CALayer layer]; layer.backgroundColor = [UIColor blueColor].CGColor; // 设置frame layer.frame = CGRectMake(100, 100, 100, 100); // 添加到控制器view的图层上面 [self.view.layer addSublayer:layer]; self.layer = layer; } - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // self.layer.backgroundColor = [UIColor orangeColor].CGColor; // self.layer.position = CGPointMake(300, 300); // // 开启事务 [CATransaction begin]; // 禁止隐式动画 [CATransaction setDisableActions:YES]; self.layer.bounds = CGRectMake(0, 0, 400, 400); // 提交事务 [CATransaction commit]; }
  • 相关阅读:
    搜刮一些开源项目的APP
    iOS Crash文件的解析
    iOS中RGB颜色转换
    随笔杂记
    iOS字体
    方法总结
    经验点滴
    个人理解
    OC 知识点回顾
    IOS UI 笔记整理回顾
  • 原文地址:https://www.cnblogs.com/neilHoIOS/p/4628435.html
Copyright © 2011-2022 走看看