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

  • 相关阅读:
    python微信公众号开发学习记录
    python 机器学习中模型评估和调参
    python 机器学习中的数据处理学习记录
    python中selenium操作下拉滚动条方法汇总
    解决jenkins下使用HTML Publisher插件后查看html报告显示不正常
    python nose测试框架全面介绍四
    python nose测试框架全面介绍三
    python nose测试框架全面介绍二
    python nose测试框架全面介绍一
    jmeter BeanShell实例-----两个变量之间的断言对比
  • 原文地址:https://www.cnblogs.com/linximu/p/4414363.html
Copyright © 2011-2022 走看看