Ejemplo n.º 1
0
        protected override void OnInitializeNavBarItems(List <UIBarButtonItem> navBarItems)
        {
            base.OnInitializeNavBarItems(navBarItems);

            // Day Button
            _dayButton = ButtonBarUtil.Create(SemiTransparentType.Light);
            _dayButton.LineBreakMode  = UILineBreakMode.WordWrap;
            _dayButton.TouchUpInside += OnDayButtonClicked;

            _dayButtonItem            = new UIBarButtonItem();
            _dayButtonItem.CustomView = _dayButton;

            navBarItems.Add(_dayButtonItem);

            // Mode (List, Map, Combined) Button
            _modeButton = ButtonBarUtil.Create(
                ThemeIcons.List,
                ThemeIcons.ListLandscape,
                SemiTransparentType.Light);
            _modeButton.TouchUpInside += OnModeButtonClicked;

            _modeButtonItem            = new UIBarButtonItem();
            _modeButtonItem.CustomView = _modeButton;

            navBarItems.Add(_modeButtonItem);
        }
Ejemplo n.º 2
0
        private void InitializeNavBarItems()
        {
            var navBarItems = new List <UIBarButtonItem>();
            var gap         = ButtonBarUtil.CreateGapSpacer();

            // replacing default iOS back button
            if (IsBackButtonVisible &&
                NavigationController != null &&
                NavigationController.ViewControllers.Length > 1)
            {
                NavigationItem.HidesBackButton = true;

                _backButton = ButtonBarUtil.Create(
                    ThemeIcons.Back,
                    ThemeIcons.BackLandscape,
                    SemiTransparentType.Light);
                _backButton.TouchUpInside += OnNavigationBackClick;
                _backButton.UpdateState();

                var backBarButton = new UIBarButtonItem(_backButton);
                NavigationItem.SetLeftBarButtonItems(new [] { gap, backBarButton }, true);
            }

            OnInitializeNavBarItems(navBarItems);

            // More (...) Button
            if (IsMoreButtonVisible)
            {
                _moreButton = ButtonBarUtil.Create(
                    ThemeIcons.More,
                    ThemeIcons.MoreLandscape,
                    SemiTransparentType.Light);
                _moreButton.TouchUpInside += OnMoreButtonClicked;

                var moreBarButton = new UIBarButtonItem(_moreButton);
                navBarItems.AddRange(new [] { moreBarButton, gap });
            }

            navBarItems.Reverse();

            NavigationItem.SetRightBarButtonItems(navBarItems.ToArray(), true);
        }
Ejemplo n.º 3
0
        private void InitializeNavBarItems()
        {
            var gap = ButtonBarUtil.CreateGapSpacer();

            _closeButton = ButtonBarUtil.Create(
                ThemeIcons.Close,
                ThemeIcons.CloseLandscape);
            _closeButton.TouchUpInside += OnCloseButtonClick;
            var closeButtonItem = new UIBarButtonItem(_closeButton);

            _backButton = ButtonBarUtil.Create(
                ThemeIcons.Back,
                ThemeIcons.BackLandscape);
            _backButton.TouchUpInside += OnBackButtonClick;
            _backButtonItem            = new UIBarButtonItem(_backButton);

            NavigationItem.SetLeftBarButtonItems(new [] { gap, closeButtonItem, _backButtonItem }, true);

            _indicatorView = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.White)
            {
                Frame = new CGRect(0, 0, 40, 40)
            };
            _progressButtonItem = new UIBarButtonItem(_indicatorView);

            _forwardButton = ButtonBarUtil.Create(
                ThemeIcons.Forward,
                ThemeIcons.ForwardLandscape);
            _forwardButton.TouchUpInside += OnForwardButtonClick;
            _forwardButtonItem            = new UIBarButtonItem(_forwardButton);

            _moreButton = ButtonBarUtil.Create(
                ThemeIcons.More,
                ThemeIcons.MoreLandscape);
            _moreButton.TouchUpInside += OnMoreButtonClicked;
            var moreButtonItem = new UIBarButtonItem(_moreButton);

            NavigationItem.SetRightBarButtonItems(
                new [] { gap, moreButtonItem, _forwardButtonItem, _progressButtonItem }, true);
        }