gpt4 book ai didi

c# - MonoTouch - UIView.Animate 完成回调未在按钮 touchUpInside 委托(delegate)内调用

转载 作者:行者123 更新时间:2023-11-29 12:47:16 27 4
gpt4 key购买 nike

我正在使用以下代码在按下 UIButton 时为某些元素设置动画,但在动画完成时不会调用 UIView.Animate 完成回调。

如果我将 UIView.Animate block 移到 touchUpInside 委托(delegate)之外,则会触发动画完成回调。我做错了什么吗?

        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 ();
}
});


};

最佳答案

我想出了问题所在。我正在使用到 Obj-C 库 FXBlurView 的绑定(bind)。我使用的库版本存在错误,导致未调用 UIView 动画完成回调。它在库的 1.6.1 版本中得到修复。可以在这里找到:https://github.com/nicklockwood/FXBlurView

关于c# - MonoTouch - UIView.Animate 完成回调未在按钮 touchUpInside 委托(delegate)内调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23339777/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com