감사합니다.
두 번째 대답은 전역 변수를 사용하고 콜백 매개 변수를 건너 뜁니다. 다음은 첫 번째 대답을 기반으로 오늘 알아 낸 것입니다.
private void BeginPulse (Button button)
{
UIView.BeginAnimations (button+"fadeIn", button.Handle);
UIView.SetAnimationDelegate (this);
UIView.SetAnimationDidStopSelector (new MonoTouch.ObjCRuntime.Selector ("makeVisibleAgain:finished:context:"));
UIView.SetAnimationCurve(UIViewAnimationCurve.EaseOut);
UIView.SetAnimationDuration (0.5);
button.Alpha = 0.25f;
UIView.CommitAnimations();
}
[Export ("makeVisibleAgain:finished:context:")]
private void EndPulse (NSString animationId, NSNumber finished, UIButton button)
{
UIView.BeginAnimations (null, System.IntPtr.Zero);
UIView.SetAnimationDelegate (this);
UIView.SetAnimationCurve (UIViewAnimationCurve.EaseIn);
UIView.SetAnimationDuration (0.5);
button.Alpha = 1;
UIView.CommitAnimations();
}
매우 모노로 포팅하기 쉽다. – rpetrich