Exemple #1
0
        public void ManageBottomBar(UIView view)
        {
            _tabBarController = new HidingViewController(view);
            _tabBarController.ContractsUpwards = false;
            _tabBarController.ExpandedCenter   = uiView =>
            {
                var height = _viewController.View.Frame.Height;
                var point  = new CGPoint(view.Bounds.GetMidX(), height - view.Bounds.GetMidY());

                return(point);
            };
        }
Exemple #2
0
        public HidingNavigationBarManager(UIViewController viewController, UIScrollView scrollView)
        {
            if (viewController.NavigationController?.NavigationBar == null)
            {
                // error
            }

            OnForegroundAction = HidingNavigationForegroundAction.Default;

            viewController.ExtendedLayoutIncludesOpaqueBars = true;

            _viewController = viewController;

            _extensionController = new HidingViewController();
            viewController.View.Add(_extensionController.View);

            var navbar = viewController.NavigationController?.NavigationBar;

            _navBarController                 = new HidingViewController(navbar);
            _navBarController.Child           = _extensionController;
            _navBarController.AlphaFadeEnable = true;

            Init();


            UpdateScrollView(scrollView);


            _navBarController.ExpandedCenter = (view => new CGPoint(view.Bounds.GetMidX(), view.Bounds.GetMidY() + (StatusBarHeight())));

            _extensionController.ExpandedCenter = view =>
            {
                var topOffset = _navBarController.ContractionAmountValue() + StatusBarHeight();
                var point     = new CGPoint(view.Bounds.GetMidX(), view.Bounds.GetMidY() + topOffset);
                return(point);
            };

            UpdateContentInset();

            _applicationWillEnterForegroundNotificationToken = UIApplication.Notifications.ObserveWillEnterForeground(ApplicationWillEnterForeGround);
        }