zoukankan      html  css  js  c++  java
  • 动画demo

    #import "ViewController.h"

    @interface ViewController ()

    @end

    @implementation ViewController

    -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

    {

      //  [UIView transitionWithView:self.aView duration:2 options:UIViewAnimationOptionTransitionFlipFromRight animations:nil completion:nil];

        

        

        self.aView.layer.borderColor=[[UIColor blackColor]CGColor];

      //  self.aView.layer.borderWidth=5;

       // self.aView.layer.cornerRadius=10;//设置圆角

        self.aView.layer.contents=(id)[UIImage imageNamed:@"l.jpg"].CGImage;

        self.aView.layer.shadowColor=[UIColor blackColor].CGColor;

        self.aView.layer.shadowOffset=CGSizeMake(10, 10);

        self.aView.layer.shadowOpacity=1;

        

    }

    -(void)test2

    {

        if ([_fromView subviews]) {

            [UIView transitionFromView:_fromView toView:_toView duration:2 options:UIViewAnimationOptionTransitionFlipFromLeft completion:nil];

        }else{

            [UIView transitionFromView:_toView toView:_fromView duration:2 options:UIViewAnimationOptionTransitionFlipFromLeft completion:nil];

        }

    }

    -(void)test1

    {

        [UIView animateWithDuration:2 animations:^{

            self.aView.center=CGPointMake(300, 300);//设置动画的结束状态

        } completion:^(BOOL finished) {

            NSLog(@"js");

        }];

    }

    -(void)test

    {

        [UIView beginAnimations:nil context:nil];

        [UIView setAnimationDuration:2];

        //self.aView.alpha=0;

        // self.aView.center=CGPointMake(300, 300);

        // self.aView.backgroundColor=[UIColor redColor];

        [UIView setAnimationDelegate:self];

        self.aView.bounds=CGRectMake(0, 100, 10, 10);

        [UIView setAnimationDidStopSelector:@selector(stop)];

        

        

        

        [UIView commitAnimations];

    }

    -(void)stop

    {

        NSLog(@"jieshu");

    }

    - (void)viewDidLoad {

        

    //    _showView=[[UIView alloc]initWithFrame:CGRectMake(100, 100, 200, 200)];

    //    // _showView.backgroundColor=[UIColor yellowColor];

    //    _fromView=[[UIView alloc]initWithFrame:_showView.bounds];

    //    _fromView.backgroundColor=[UIColor blueColor];

    //    

    //    _toView=[[UIView alloc]initWithFrame:_showView.bounds];

    //    

    //    _toView.backgroundColor=[UIColor redColor];

    //    

    //    

    //    [self.view addSubview:_showView];

    //   // [_showView addSubview:_toView];

    //    

    //    [_showView addSubview:_fromView];

        

        

        

    //    CALayer *calayer=[CALayer new];

    //    calayer.backgroundColor=[UIColor orangeColor].CGColor;

    //    calayer.bounds=CGRectMake(100, 100, 200,200);

    //    [self.view.layer addSublayer:calayer];

        

        

        NSLog(@"====%@",self.view.layer.sublayers);

        NSLog(@"---%@",self.view.subviews);

        [super viewDidLoad];

        // Do any additional setup after loading the view, typically from a nib.

    }

    - (void)didReceiveMemoryWarning {

        [super didReceiveMemoryWarning];

        // Dispose of any resources that can be recreated.

    }

    @end

  • 相关阅读:
    HDU 5791 Two (DP)
    POJ 1088 滑雪 (DPor记忆化搜索)
    LightOJ 1011
    POJ 1787 Charlie's Change (多重背包 带结果组成)
    HDU 5550 Game Rooms (ccpc2015 K)(dp)
    HDU 5542 The Battle of Chibi (ccpc 南阳 C)(DP 树状数组 离散化)
    HDU 5543 Pick The Sticks (01背包)
    HDU 5546 Ancient Go (ccpc2015南阳G)
    NB-IoT的DRX、eDRX、PSM三个模式 (转载,描述的简单易懂)
    MQTT 嵌入式端通讯协议解析(转)
  • 原文地址:https://www.cnblogs.com/linximu/p/4414363.html
Copyright © 2011-2022 走看看