Full page Transition effect from Top to Bottom on Click event for left side header use Icon menu

Hello,

I am developing an application using Xamarin Forms only targeting iOS.

By using "SlideOverKit", I have created one Hamburger Menu on left side of the header(Used SlideOverKit because it has to be full page length). But on the right side of the header, I want to insert User Profile Icon on which when I click, it popups the full page length login page. Also, I want Login Page open from Top to Bottom effect and when again I click it disappear from bottom to top.

Anybody please suggest me which animation effect or method to be use. I am getting output but it's not exactly how it suppose to be. Any Suggestions??

For tap event I used below code.

    private async void Logout_Tapped(object sender, EventArgs e)
            {
                if (App.IsLogout)
                {
                    //await Navigation.PopAsync(new bool());
                    //await Navigation.PopAsync(new bool());
                    MessagingCenter.Send<string> ("popup", "Hi");
                }
                else
                {
                    App.IsAnimationNav = true;
                    await Navigation.PushAsync(new LogOutView());
                }
            }

Also, I have created one Custom Renderer in .iOS.

        public override void PushViewController(UIViewController viewController, bool animated)
                {
                    if (animated)
                    {
                        // Alternative way with different set of trannsition
                        if (App.IsAnimationNav)
                        {
                            App.IsAnimationNav = true;
                            var transition = CATransition.CreateAnimation();

                            transition.Duration = 0.5;
                            transition.Type = CAAnimation.TransitionFromTop;
                            View.Layer.AddAnimation(transition, null);
                        }
                        base.PushViewController(viewController, false);
                    }
                    else
                    {
                        base.PushViewController(viewController, true);
                    }
                }

                public override UIViewController PopViewController(bool animated)
                {
                 if (animated)
                    {
                        var transition = CATransition.CreateAnimation();
                        transition.Duration = 0.5;
                        transition.Type = CAAnimation.TransitionFromBottom;

                        View.Layer.AddAnimation(transition, null);
                        return base.PopViewController(false);
                    }
                    else
                    {
                        return base.PopViewController(true);
                    }
                }

Best Answer

Answers

  • AdrnHAdrnH USMember ✭✭
    edited June 17

    should be:

    transition.Type = CAAnimation.TransitionPush;
    transition.Subtype = CAAnimation.TransitionFromTop;
    
Sign In or Register to comment.