泰州网站制作公司,中国空间站机械臂,网站类型定位分析,免费咨询法律律师在线12348关键字 1.Core Animation的核心类是CALayer,通过对其属性进行配置可以展现不同的外观#xff0c;这些属性包括位置#xff0c;尺寸#xff0c;图片内容#xff0c;背景色#xff0c;边界#xff0c;阴影#xff0c;以及角半径。 CATextLayer *textLayer;textLayer [CAT… 关键字 1.Core Animation的核心类是CALayer,通过对其属性进行配置可以展现不同的外观这些属性包括位置尺寸图片内容背景色边界阴影以及角半径。 CATextLayer *textLayer;textLayer [CATextLayer layer];textLayer.anchorPoint CGPointZero;//限定层的边界矩形的定位点如在一个点normalized层坐标 - 0,0是左下角边界矩形1,1是右上角。默认为0.50.5即边界矩形的中心。textLayer.position CGPointMake(10, 6);//该层的边界矩形的定位点对准在superlayer的位置。默认为零点textLayer.zPosition 100;//在其superlayer层的位置的Z分量。默认为零textLayer.fontSize 24;textLayer.foregroundColor CGColorGetConstantColor(kCGColorWhite); View Code CALayer:图层也是按层级关系组织不是响应链的一部分。 2.CAAnimation .控制图层属性产生的动画。 CABasicAnimation *posAnim [CABasicAnimation animation]; posAnim.fromValue [NSValue valueWithPoint:center];posAnim.duration 1.5;posAnim.timingFunction tf;CABasicAnimation *bdsAnim [CABasicAnimation animation];bdsAnim.fromValue [NSValue valueWithRect:NSZeroRect];bdsAnim.duration 1.5;bdsAnim.timingFunction tf;CALayer *layer [CALayer layer];layer.contents image;layer.actions [NSDictionary dictionaryWithObjectsAndKeys:posAnim, position, bdsAnim, bounds, nil]; View Code 3.CATransaction用于多个动画的分组及同步也可以临时禁用动画。 [CATransaction begin];[view.layer addSublayer:layer];layer.position randomPoint;layer.bounds NSRectToCGRect(imageBounds);[CATransaction commit]; View Code 2.联系 待续…. 版权声明本文为博主原创文章未经博主允许不得转载。 转载于:https://www.cnblogs.com/H7N9/p/4888844.html