1
我使用下面的代碼來動畫按下UIButton時的一些元素,但UIView.Animate完成回調不會在動畫完成時被調用。MonoTouch - UIView.Animate完成回調不在按鈕內調用touchUpInside委託
如果我將UIView.Animate塊移動到touchUpInside委託之外,則會觸發動畫完成回調。難道我做錯了什麼?
close_loginemail.TouchUpInside += delegate(object sender, EventArgs e) {
//Animate first_screen_view and second_screen_view left
UIView.Animate (0.3, 0, UIViewAnimationOptions.CurveEaseInOut,() => {
login_email_view.Alpha = 0.0f;
login_blur.BlurRadius = 0f;
}, //Completion callback
() => {
Console.WriteLine ("test");
login_email_view.Frame = new RectangleF (View.Frame.Width, 0, View.Frame.Width, View.Frame.Height);
if (loginemail_field.IsFirstResponder) {
loginemail_field.ResignFirstResponder();
}
if (loginpassword_field.IsFirstResponder) {
loginpassword_field.ResignFirstResponder();
}
});
};