- (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");
}