添加動畫一 (上下包含法)beginAnimatioins
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2.0f]; // 時間間隔
[UIView setAnimationDelegate:self]; // 設(shè)置為代理還可以設(shè)置一些代理方法
[UIView setAnimationWillStartSelector:@selector(willStart)];
[UIView setAnimationDidStopSelector:@selector(stop)];
// 設(shè)置需要做的動畫
[UIView commitAnimations];
添加動畫二 block方法
[UIView animateWithDuration:2.0f animations:^{
// 設(shè)置需要做的動畫
}];
添加動畫三 block方法二
[UIView animateWithDuration:2.0f animations:^{
// 設(shè)置需要做的動畫
} completion:^(BOOL finished) {
// 做完動畫需要做什么事
}];
添加動畫四 系統(tǒng)自帶對于某些特殊情況 - setContentOffset:animated;
CGPoint point = self.scrollView.contentOffset;
point.y = self.scrollView.frame.size.height;
[self.scrollView setContentOffset:point animated:YES];
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。