コード例 #1
0
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);

                var coordinator = viewController.GetTransitionCoordinator();

                if (coordinator != null)
                {
                    // handle swipe to dismiss gesture
                    coordinator.NotifyWhenInteractionEndsUsingBlock((context) =>
                    {
                        if (!context.IsCancelled)
                        {
                            _self._popCompletionTask = new TaskCompletionSource <bool>();
                            _self.SendPoppedOnCompletion(_self._popCompletionTask.Task);
                        }
                    });
                }
            }
コード例 #2
0
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);

                var coordinator = viewController.GetTransitionCoordinator();

                if (coordinator != null && coordinator.IsInteractive)
                {
                    // handle swipe to dismiss gesture
                    if (Forms.IsiOS10OrNewer)
                    {
                        coordinator.NotifyWhenInteractionChanges(OnInteractionChanged);
                    }
                    else
                    {
                        coordinator.NotifyWhenInteractionEndsUsingBlock(OnInteractionChanged);
                    }
                }
            }
コード例 #3
0
            public override void WillShowViewController(UINavigationController navigationController, [Transient] UIViewController viewController, bool animated)
            {
                var element = _self.ElementForViewController(viewController);

                bool navBarVisible;

                if (element is ShellSection)
                {
                    navBarVisible = _self._renderer.ShowNavBar;
                }
                else
                {
                    navBarVisible = Shell.GetNavBarIsVisible(element);
                }

                navigationController.SetNavigationBarHidden(!navBarVisible, true);
            }