首页 > 代码库 > CABasicAnimation学习Demo 包含了一些经常使用的动画效果

CABasicAnimation学习Demo 包含了一些经常使用的动画效果

个人写的一些样例:

//
//  ViewController.m
//  CABasicAnimationDemo
//
//  Created by haotian on 14-6-13.
//  Copyright (c) 2014年 Baseus. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController
@synthesize ViewTest;
- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    //self.ViewTest.backgroundColor = [UIColor redColor];
    //组合动画调用
    //[self startAnimation2];
    
    //永久闪烁动画
    //[self opacityForever_Animation:0.3];
    
    ////有闪烁次数的动画
    //[self opacityTimes_Animation:10 durTimes:0.3];
    
    //画一条线    路径
    [self drawACurvedLine];
    
    //路径动画
    //[self animateCicleAlongPath];
    
}

-(void)startAnimation
{
    CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"position"];
    animation.fromValue = http://www.mamicode.com/[NSValue valueWithCGPoint:CGPointMake(50, 50)];>
 

最后附上Demo下载地址:http://download.csdn.net/detail/u012951123/7500419