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); }
private void UpdateItemsState() { var buttons = ButtonBarUtil.GetButtonsFromBarItems(TopItem.GetNavItemBarItems()); foreach (var button in buttons) { button.SemiTransparentType = ItemSemiTransparentType; button.UpdateState(); } }
public override void LayoutSubviews() { base.LayoutSubviews(); // manually adjusting position of items in landscape (stick it to bottom) if (!ScreenUtil.IsVerticalOrientation) { var itemViews = ButtonBarUtil.GetViewsFromBarItems(TopItem.GetNavItemBarItems()); foreach (var itemView in itemViews) { var frame = new CGRect( new CGPoint(itemView.Frame.X, Frame.Height - itemView.Frame.Height), itemView.Frame.Size); itemView.Frame = frame; } } }
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); }
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); }
private void UpdateButtonsFrameOnRotation() { ButtonBarUtil.UpdateButtonsFrameOnRotation(NavigationItem.GetNavItemBarItems()); }
private void UpdateButtonsFrameOnRotation() { ButtonBarUtil.UpdateButtonsFrameOnRotation(new [] { MapFullscreenButton }); }