我有scrollview
,其中有zoomscale物業內uiview
開始animation
,它以動畫以及一些時間,但在這些animations
之間我想暫停animation
和恢復animation
,請幫我出這個如何在點擊按鈕時暫停和恢復uiview動畫?
[UIView beginAnimations:@"anim1" context:NULL];
[UIView setAnimationDelegate:self];
[UIView setAnimationDuration:fanim];
z = [[arrImage1 objectAtIndex:1] floatValue];
scroll.zoomScale = z;
NSLog(@" %f",scroll.zoomScale);
if (iw != 0 || ih != 0)
{
image1.frame = CGRectMake(0, 0, iw,ih);
}
z = [[arrImage2 objectAtIndex:1] floatValue];
scroll1.zoomScale = z;
z = [[arrImage3 objectAtIndex:1] floatValue];
scroll2.zoomScale = z;
[UIView commitAnimations];
你可以參考以下幾點: http://stackoverflow.com/questions/3211065/how-to-pause-and-resume-uiview-animation 和 HTTP:/ /stackoverflow.com/questions/9104487/how-to-pause-and-resume-uiview-animation-without-block-animation – 2013-04-08 05:16:23