【问题标题】:MonoTouch - UIView.Animate completion callback is not called inside button touchUpInside delegateMonoTouch - UIView.Animate 完成回调未在按钮 touchUpInside 委托内调用
【发布时间】:2014-04-28 11:21:47
【问题描述】:

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

如果我将 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 ();
                }
            });


        };

【问题讨论】:

    标签: c# ios animation uiview


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多