IOS 动画_技术成长笔记_新浪博客

- (void)viewDidLoad

{

    [super viewDidLoad];

 

  UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];

    label.backgroundColor = [UIColor greenColor];

    [self.view addSubview:label];

    

//    UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(60, 60, 100, 40)];

//    label1.backgroundColor = [UIColor redColor];

//    [self.view addSubview:label1];

    

    [UIView beginAnimations:@"label" context:NULL];

    [UIView setAnimationDuration:3];

    label.frame = CGRectMake(100, 100, 200, 60);

    [UIView commitAnimations];

    [UIView beginAnimations:@"label1" context:NULL];

    [UIView setAnimationDuration:3];

    [UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];

    

  //label1.frame = CGRectMake(100, 100, 200, 60);

    [UIView commitAnimations];

}


//? 非正常的时候用

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context

{

    

}

//动画

- (void)viewAni

{

    [UIView beginAnimations:nil context:NULL];

    [UIView setAnimationDuration:2];

    

    [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:NO];

    [UIView commitAnimations];

}

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

{

    [self viewAni];

    NSLog(@"dfdsfdsfdsfd");

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值