UIImageView cihazını bir UIView uygulamasına kaydırmaya ve aynı anda silmeye çalışıyorum. Ve sonra solması ve kaymasını istiyorum. Aşağıdaki kod bunu yapmalıdır, ancak yapmaz. Bunun yerine, leftArrow görünümü, slaytta tam olarak alfa. Bu nedenle, ilk animasyon alfa fade-in'i atlıyor. Daha sonra ikinci animasyon soluklaşır, soldaki görünüşü hareket ettirmez. Çok sayıda varyasyon denedim (çerçeveler yerine sınırlar kullanarak, bir sınıf yönteminde (örnek yönteminin tersine) animasyonu yapıyordum ve görüşün neden diğerinden ziyade bir şeyi yapmak istediğini belirleyemem. . ya da her ikisi Belki sadece taze gözlerime ihtiyacım TIA, Mikebasit UIView animasyon zinciri çalışmıyor
- (void) flashHorizontalArrowsForView: (UIView *)view {
DebugLog(@" flashHorizontalArrows");
float duration = 1.5f;
// create the views
UIImageView *leftArrow = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"leftCouponDetailArrow.png"]];
leftArrow.frame = CGRectMake(0 -leftArrow.image.size.width,
HORIZONTAL_ARROW_START_Y,
leftArrow.image.size.width,
leftArrow.image.size.height);
[view addSubview:leftArrow];
leftArrow.alpha = 0.0f;
// animate them in...
[UIView beginAnimations:@"foo" context:leftArrow];
[UIView setAnimationDelay: 0.0f ]; // in seconds
[UIView setAnimationDuration: duration ];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationDidStopSelector:@selector(animationReallyDidStop:finished:context:)];
[UIView setAnimationDelegate:self];
leftArrow.alpha = 1.0f;
CGRect LFrame = leftArrow.frame;
LFrame.origin.x += LFrame.size.width; // move it in from the left.
leftArrow.frame = LFrame;
[UIView commitAnimations];
// and animate them out
// delay enough for the first one to finish
[UIView beginAnimations:@"bar" context:leftArrow];
[UIView setAnimationDelay: duration+0.05 ]; // in seconds
[UIView setAnimationDuration: duration ];
[UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
[UIView setAnimationDidStopSelector:@selector(animationReallyDidStop:finished:context:)];
[UIView setAnimationDelegate:self];
leftArrow.alpha = 0.0f;
CGRect LLFrame = leftArrow.bounds;
LLFrame.origin.x -= LLFrame.size.width; // move it off to the left.
leftArrow.bounds = LLFrame;
[UIView commitAnimations];
}
btw ben XCode 3.2.4 çalıştırıyorum ve bu animasyon 4.1 iPhone simülatörü ve 3.1.3 cihazla başarısız olur. – Rayfleck