上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: 1 CATransform3DMakeRotation(CGFloat angle, CGFloat x, CGFloat y, CGFloat z); // 旋转2 3 CATransform3DMakeScale(CGFloat sx, CGFloat sy, CGFloat sz); // 缩放1 CATransform3D transform = CATransform3DMakeScale(0.50, 0.50, 1.0);2 3 [pulseAnimation setToValue:[NSValue valueWithCATransform3D:CATransfor... 阅读全文
posted @ 2013-02-10 17:30 diablo大王 阅读(6069) 评论(0) 推荐(0) 编辑
摘要: areAnimationsEnabled返回一个布尔值表示动画是否结束。+ (BOOL)areAnimationsEnabled返回值如果动画结束返回YES,否则NO。beginAnimations:context:开始一个动画块+ (void)beginAnimations:(NSString *)animationID context:(void *)context参数animationID动画块内部应用程序标识用来传递给动画代理消息-这个选择器运用setAnimationWillStartSelector:和setAnimationDidStopSelector: 方法来设置。conte 阅读全文
posted @ 2013-02-09 10:57 diablo大王 阅读(462) 评论(0) 推荐(0) 编辑
摘要: 1 UIView *containerView = [[[UIView alloc] initWithFrame:CGRectMake(20, 20, 280, 300)] autorelease];2 containerView.backgroundColor = [UIColor clearColor];3 containerView.layer.shadowOffset = CGSizeMake(0, 2);4 containerView.layer.shadowOpacity = 0.80; 阅读全文
posted @ 2013-02-09 10:24 diablo大王 阅读(6280) 评论(0) 推荐(0) 编辑
摘要: 1 - (void)fadeMe { 2 [UIView animateWithDuration:1.0 animations:^{ 3 fadeMeView.alpha = 0.0f; // 作用在fadeMeView视图 4 }]; 5 } 6 7 - (void)moveMe { 8 [UIView animateWithDuration:0.5 animations:^{ 9 moveMeView.center = CGPointMake(moveMeView.center.x , mo... 阅读全文
posted @ 2013-02-09 10:16 diablo大王 阅读(14562) 评论(0) 推荐(0) 编辑
摘要: 1 UIImage *image = [UIImage imageNamed:@"heart.png"]; 2 CALayer *layer = [CALayer layer]; 3 layer.contents = (id)image.CGImage; 4 layer.bounds = CGRectMake(0, 0, image.size.width, image.size.height); 5 layer.position = CGPointMake(160, 200); 6 7 layer.transform = CATransfor... 阅读全文
posted @ 2013-02-08 22:25 diablo大王 阅读(326) 评论(0) 推荐(0) 编辑
摘要: CAGradientLayer可以方便的处理颜色渐变。 1 self.view.backgroundColor = [UIColor whiteColor]; 2 UIImage *image = [UIImage imageNamed:@"mountains.png"]; // 原图 3 4 CALayer *imageLayer = [CALayer layer]; 5 imageLayer.borderColor = [UIColor greenColor].CGColor; 6 imageLayer.borderWidth = 2; 7 ... 阅读全文
posted @ 2013-02-08 22:12 diablo大王 阅读(1733) 评论(0) 推荐(0) 编辑
摘要: 1 CALayer *layer = [[self.view.layer sublayers] objectAtIndex:0]; layer.shadowPath = (layer.shadowPath) ? nil : [self bezierPathWithCurvedShadowForRect:layer.bounds2 ].CGPath; 1 static const CGFloat offset = 10.0; 2 static const CGFloat curve = 5.0; 3 - (UIBezierPath*)bezierPathWithCurvedSh... 阅读全文
posted @ 2013-02-08 21:00 diablo大王 阅读(526) 评论(0) 推荐(0) 编辑
摘要: 1.shadowPath: 设置 CALayer 背景(shodow)的位置2.shadowOffset: shadow 在 X 和 Y 轴 上延伸的方向,即 shadow 的大小3.shadowOpacity : shadow 的透明效果4.shadowRadius: shadow 的渐变距离,从外围开始,往里渐变 shadowRadius 距离5.masksToBounds : 很重要的属性,可以用此属性来防止子元素大小溢出父元素,如若防止溢出,请设为 true6. borderWidth 和 boarderColor : 边框颜色和宽度,很常用7.bounds: 大小,与position 阅读全文
posted @ 2013-02-08 20:57 diablo大王 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1 CABasicAnimation *transformAnimation = [CABasicAnimation animationWithKeyPath:@"transform"];2 transformAnimation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];3 transformAnimation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(DEGREES_TO_RADIAN.. 阅读全文
posted @ 2013-02-08 20:08 diablo大王 阅读(1646) 评论(0) 推荐(0) 编辑
摘要: { NSLog(@"111"); SEL rl = @selector(rotateLayers); [selfperformSelector:rl withObject:nilafterDelay:1.0];// 这里不延时1秒 NSLog(@"222");}- (void)rotateLayers { NSLog(@"333");}结果:19:47:55.326 CA Demos[5138:907] 11119:47:55.327 CA Demos[5138:907] 22219:47:56.329 CA Demos[5138:9 阅读全文
posted @ 2013-02-08 19:52 diablo大王 阅读(2306) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页