iOS CoreAnimation AnimationWithKeyPath 来改变动画 的Key

来源:互联网 发布:java初级程序员工资 编辑:程序博客网 时间:2024/05/16 23:34

可以通过改变animationWithKeyPath来改变动画:

transform.scale = 比例转换

transform.scale.x = 宽的比例转换

transform.scale.y = 高的比例转换

transform.rotation.z = 平面图的旋转

opacity = 透明度

margin

zPosition

backgroundColor 背景颜色

cornerRadius 圆角

borderWidth

bounds

contents

contentsRect

cornerRadius

frame

hidden

mask

masksToBounds

opacity

position

shadowColor

shadowOffset

shadowOpacity

shadowRadius


[objc] view plain copy
  1. // Create animation for location change  
  2.        CABasicAnimation *locationAnimation = [CABasicAnimation animationWithKeyPath:@"locations"];  
  3.        locationAnimation.fromValue = gradientMask.locations;  
  4.        locationAnimation.toValue = adjustedLocations;  
  5.        locationAnimation.duration = 0.25;  
  6.          
  7.        // Create animation for color change  
  8.        CABasicAnimation *colorAnimation = [CABasicAnimation animationWithKeyPath:@"colors"];  
  9.        colorAnimation.fromValue = gradientMask.colors;  
  10.        colorAnimation.toValue = adjustedColo  


0 0
原创粉丝点击