CAlayer的一些基本属性应用
2012-05-07 14:21
281 查看
self.aView.layer setCornerRadius:8.0];//圆角 self.aView.layer setShadowColor:[[UIColor blackColor]CGColor]];//阴影颜色 self.aView.layer setShadowOffset:CGSizeMake(10, 10)];//阴影距离 self.aView.layer setShadowOpacity:0.2]; self.aView.layer setShadowRadius:0];//阴影模糊程度 self.aView.layer setBorderColor:[[UIColor redColor] CGColor]];//描边颜色 self.aView.layer setBorderWidth:2.0];//描边粗细
CALayer 按指定的点 运动
CGMutablePathRef thePath =CGPathCreateMutable(); CGPathMoveToPoint(thePath,NULL,aLayer.position.x, aLayer.position.y - 10); CGPathAddCurveToPoint(thePath,NULL, aLayer.position.x, aLayer.position.y -30, aLayer.position.x, aLayer.position.y -50, aPoint.x, aPoint.y); CAKeyframeAnimation *theAnimation = [CAKeyframeAnimationanimationWithKeyPath:@"position"]; theAnimation.path = thePath; theAnimation.duration = duration; CFRelease(thePath); theAnimation.removedOnCompletion =YES; [aLayer addAnimation:theAnimation forKey:@"position"];
CALayer 缩放动画
//放大
CAKeyframeAnimation* animation = [CAKeyframeAnimationanimationWithKeyPath:@"transform"]; NSMutableArray *values = [NSMutableArrayarray]; [valuesaddObject:[NSValuevalueWithCATransform3D:CATransform3DMakeScale(0.9f,0.9f,1.0f)]]; [valuesaddObject:[NSValuevalueWithCATransform3D:CATransform3DMakeScale(1.0f,1.0f,1.0f)]]; animation.values = values; animation.duration = duration; animation.timingFunction = [CAMediaTimingFunctionfunctionWithName:kCAMediaTimingFunctionEaseIn]; [aLayer addAnimation:animation forKey:@"transform"];该代码可实现CAlayer的缩放
相关文章推荐
- CAlayer的一些基本属性应用
- CSS flex 布局 一些基本属性应用
- 前面在《Asp.Net Forums中对.Net中序列化和反序列化的应用》一文中讲了,对于一些扩展属性,可以将字符串集合序列化为二进制,也可以从二进制反序列化为字符串集合。其实我一直有个疑问,对于asp.net中可以很容易实现,但是在asp中该如何?
- input 的一些基本属性使用以及控制图形旋转
- CALayer设置图片等的一些属性
- Python基本语法_函数属性 & 参数类型 & 偏函数的应用
- 一些vc的基本知识,创建应用实例的步骤
- CALayer 的一些重要属性
- Java-基本数据类型的一些常规属性
- 二、Python的一些基本应用
- 关于highcharts的一些基本属性 4000
- 有关background一些基本属性
- CALayer的基本属性和contexts的内容 即添加图片
- IOS开发图层CALayer的基本属性使用
- 日期类的创建和一些基本应用。
- CALayer与UIView及一些基本的3D变换
- 在VC中应用MSXML DOM 的一些基本实现方法
- phpexcel基本属性及应用
- webView的基本属性设置以及遇到的一些坑
- Android: Selector 与 Shape 属性的一些基本用法