CABasicAnimation *shake = [CABasicAnimation animationWithKeyPath:@"transform.translation.x"];
//transform.translation.x 设定动画类型,方向,eg:旋转,平移,缩放, from,to
shake.fromValue = from; // 从哪里
shake.toValue = to; // 到哪里
shake.byValue = by; // 偏移
shake.speed = 8; // 正常速度的 n倍
shake.autoreverses = YES;//是否自动重复????
shake.repeatCount = FLT_MAX; //动画重复次数,eg:FLT_MAX 一直重复
shake.duration = 1; // 持续时间, 越短,动画越快
shake.fillMode = kCAFillModeForwards;
shake.removedOnCompletion = NO; //结束时 是否删除, 按钮试验的,没看到区别
[self.animationOverlay.layer addAnimation:shake forKey:@"shakeA"];
self.animationOverlay.alpha = 0.4;
1-http://www.cnblogs.com/v2m_/archive/2012/07/11/2585547.html
--view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"name.png"]];
--UIImage *image = [UIImage imageNamed:@"name.png"]; view.layer.contents = (id) image.CGImage; // 如果需要背景透明加上下面这句 view.layer.backgroundColor = [UIColor clearColor].CGColor;
2种效果相同,既frame小,只能显示一部分。
view.layer.backgroundColor = [UIColor clearColor].CGColor;-- 》不能透明
2-http://blog.csdn.net/jerryvon/article/details/8174121
3-森林狂想曲
4-http://www.cnblogs.com/pengyingh/articles/2379631.html
5-http://blog.csdn.net/jinglijun/article/details/7010241
ios画图总结