1
votes

I'm using the following code to animate some elements when pressing a UIButton but the UIView.Animate completion callback is't being called when the animation completes.

If I move the UIView.Animate block outside the touchUpInside delegate then the animation completion callback fires. Am I doing something wrong?

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


        };
1

1 Answers

1
votes

I figured out what the issue was. I'm using a binding to an Obj-C library, FXBlurView. There was a bug on the version of the library that I was using that caused the UIView animation completion callback not being called. It was fixed in the version 1.6.1 of the library. It can be found here: https://github.com/nicklockwood/FXBlurView