标签:style blog http color io os 使用 ar strong
[UIView animateWithDuration:timeInterval animations:^{ weakTableView.frame = CGRectMake(0, -height, weakSelf.frame.size.width, height); [weakTableView setAlpha:0]; }];
注意:在代码块中对对象的引用要用申明成__weak,否则会引起内存泄露。
[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:timeInterval]; [view setHidden:hide]; [UIView commitAnimations];
开始/结束动画消息定义形式:
//开始动画 -(void)animationDidStart:(NSString *)animationID context:(void *)context //结束动画 - (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut];
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:timeInterval target:self.animationCollections selector:animationSelector userInfo:nil repeats:YES];
[timer invalidate]; timer = nil;
CADisplayLink *display = [CADisplayLink displayLinkWithTarget:self.animationCollections selector:animationSelector]; [display addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[player invalidate]; timer = nil;
animation.repeatCount = FLT_MAX; animaiton.removedOnCompletion = NO;
效果
标签:style blog http color io os 使用 ar strong
原文地址:http://blog.csdn.net/shutingchen/article/details/39695835