public override void ViewDidLoad () { base.ViewDidLoad (); webView = new UIWebView (new RectangleF(0, (_addCancelButton) ? navigationBarHeight : 0, View.Frame.Width, (_addCancelButton) ? View.Frame.Height - navigationBarHeight : View.Frame.Height)); webView.Delegate = new WebViewDelegate(RequestStarted, RequestFinished); if (!_addCancelButton) { this.View.AddSubview (webView); } else { var cancelButton = new UIBarButtonItem (UIBarButtonSystemItem.Cancel); cancelButton.Clicked += (object sender, EventArgs e) => { _cancelled(); this.DismissViewController(true, null); }; var navigationItem = new UINavigationItem { LeftBarButtonItem = cancelButton }; navigationBar = new UINavigationBar (new RectangleF (0, 0, View.Frame.Width, navigationBarHeight)); navigationBar.PushNavigationItem (navigationItem, false); this.View.AddSubviews (navigationBar, webView); } }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { //Set the status bar if (Util.iOSVersion.Item1 < 6) { UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackOpaque, false); } else { UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.BlackTranslucent, false); } if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { var textAttrs = new UITextAttributes() { TextColor = UIColor.White, TextShadowColor = UIColor.DarkGray, TextShadowOffset = new UIOffset(0, -1) }; UINavigationBar.Appearance.SetTitleTextAttributes(textAttrs); UISegmentedControl.Appearance.SetTitleTextAttributes(textAttrs, UIControlState.Normal); } //Set the theming UIBarButtonItem.Appearance.SetBackButtonBackgroundImage(Images.Controls.BackButton.CreateResizableImage(new UIEdgeInsets(0, 16, 0, 10)), UIControlState.Normal, UIBarMetrics.Default); UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackButtonBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default); UIBarButtonItem.Appearance.SetBackgroundImage(Images.Controls.Button, UIControlState.Normal, UIBarMetrics.Default); UIBarButtonItem.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage(null, UIControlState.Normal, UIBarMetrics.Default); UINavigationBar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIBarMetrics.Default); UINavigationBar.AppearanceWhenContainedIn(typeof(UIPopoverController)).SetBackgroundImage(null, UIBarMetrics.Default); UIToolbar.Appearance.SetBackgroundImage(Images.Controls.Navbar.CreateResizableImage(new UIEdgeInsets(0, 0, 0, 0)), UIToolbarPosition.Any, UIBarMetrics.Default); Window = new UIWindow(UIScreen.MainScreen.Bounds); SlideController = new SlideoutNavigationController(); Window.RootViewController = SlideController; SlideController.SelectView(new RecentPatternsViewController()); Window.MakeKeyAndVisible(); if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { UIImageView killSplash = null; if (IsTall) { killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default-568h")); } else { killSplash = new UIImageView(UIImageHelper.FromFileAuto("Default")); } Window.AddSubview(killSplash); Window.BringSubviewToFront(killSplash); UIView.Animate(0.8, () => killSplash.Alpha = 0.0f, killSplash.RemoveFromSuperview); } return(true); }
void UpdateHeaderHeight() { if (this.NavigationController == null) { return; } UINavigationBar navigationBar = this.NavigationController.NavigationBar; if (navigationBar.Translucent) { UIApplication app = UIApplication.SharedApplication; bool isLandscape = UIInterfaceOrientationExtensions.IsLandscape(app.StatusBarOrientation); UIUserInterfaceIdiom idiom = UIDevice.CurrentDevice.UserInterfaceIdiom; double version = Double.Parse(UIDevice.CurrentDevice.SystemVersion); if (idiom == UIUserInterfaceIdiom.Pad && version >= 8.0) { this.headerHeight = (float)(navigationBar.IntrinsicContentSize.Height + app.StatusBarFrame.Height); } else { float statusBarSize = (float)app.StatusBarFrame.Size.Height; if (isLandscape) { statusBarSize = (float)app.StatusBarFrame.Size.Width; } this.headerHeight = (float)(navigationBar.IntrinsicContentSize.Height + statusBarSize); } } }
public NotePanel(UIViewController parentVC, Book book, CGRect frame) : base(frame) { this.BackgroundColor = eBriefingAppearance.Gray5; this.parentVC = parentVC; this.book = book; this.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleHeight; // navBar UINavigationBar navBar = new UINavigationBar(); navBar.Frame = new CGRect(0, 0, this.Frame.Width, 44); this.AddSubview(navBar); // closeButton UIBarButtonItem closeButton = new UIBarButtonItem("Close", UIBarButtonItemStyle.Plain, HandleCloseTouchUpInside); closeButton.TintColor = eBriefingAppearance.BlueColor; UINavigationItem item = new UINavigationItem(); item.RightBarButtonItem = closeButton; item.Title = "Notes"; navBar.PushNavigationItem(item, false); UIStringAttributes stringAttributes = new UIStringAttributes(); stringAttributes.StrokeColor = eBriefingAppearance.Gray3; stringAttributes.Font = eBriefingAppearance.ThemeRegularFont(17f); navBar.TitleTextAttributes = stringAttributes; }
Composer() : base(null, null) { // Navigation Bar navigationBar = new UINavigationBar(new RectangleF(0, 0, 320, 44)); navItem = new UINavigationItem(""); var close = new UIBarButtonItem(Locale.GetText("Close"), UIBarButtonItemStyle.Plain, CloseComposer); navItem.LeftBarButtonItem = close; sendItem = new UIBarButtonItem(Locale.GetText("Send"), UIBarButtonItemStyle.Plain, PostCallback); navItem.RightBarButtonItem = sendItem; navigationBar.PushNavigationItem(navItem, false); // Composer composerView = new ComposerView(ComputeComposerSize(RectangleF.Empty), this, CameraTapped); composerView.LookupUserRequested += delegate { PresentModalViewController(new UserSelector(userName => { composerView.Text += ("@" + userName + " "); }), true); }; // Add the views NSNotificationCenter.DefaultCenter.AddObserver("UIKeyboardWillShowNotification", KeyboardWillShow); View.AddSubview(composerView); View.AddSubview(navigationBar); }
public bool ShouldPushItem(UINavigationBar navigationBar, UINavigationItem item) { var v = navigationBar as NavigationBar; if (v != null) { item.BackButton().AddTarget(this, new Selector("handleBackButton"), UIControlEvent.TouchUpInside); item.BackButton().Image = v.BackButtonImage; var c = item.LeftViews(); if (c != null) { c.Add(item.BackButton()); item.SetLeftViews(c); } else { item.SetLeftViews(new List <UIView> { item.BackButton() }); } v.layoutNavigationItem(item); } return(true); }
public override void ViewDidLoad() { base.ViewDidLoad(); this.NavigationItem.Title = "Choose a currency"; UINavigationBar navBar = new UINavigationBar(); navBar.Frame = new CGRect(0, 0, this.View.Bounds.Width, 50); navBar.BarStyle = UIBarStyle.Default; UIBarButtonItem cancelButton = new UIBarButtonItem("Cancel", UIBarButtonItemStyle.Bordered, (sender, e) => { this.DismissViewController(true, () => { this.Dispose(); }); }); UINavigationItem cancel = new UINavigationItem(); cancel.SetLeftBarButtonItem(cancelButton, true); navBar.Items = new UINavigationItem[] { cancel }; this.View.AddSubview(navBar); }
public Composer() : base(null, null) { Title = "New Comment"; // Navigation Bar _navigationBar = new UINavigationBar(new RectangleF(0, 0, UIScreen.MainScreen.Bounds.Width, 44)) { AutoresizingMask = UIViewAutoresizing.FlexibleWidth, AutosizesSubviews = true }; _navItem = new UINavigationItem(""); var close = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Cancel, CloseComposer)); _navItem.LeftBarButtonItem = close; SendItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Save, PostCallback)); _navItem.RightBarButtonItem = SendItem; _navigationBar.PushNavigationItem(_navItem, false); // Composer _composerView = new ComposerView(ComputeComposerSize(RectangleF.Empty), this); // Add the views View.AddSubview(_composerView); View.AddSubview(_navigationBar); }
public bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { // this means the pop is already done, nothing we can do if (ViewControllers.Length < NavigationBar.Items.Length) { return(true); } bool allowPop = ShouldPop(); if (allowPop) { // Do not remove, wonky behavior on some versions of iOS if you dont dispatch CoreFoundation.DispatchQueue.MainQueue.DispatchAsync(() => { _popCompletionTask = new TaskCompletionSource <bool>(); SendPoppedOnCompletion(_popCompletionTask.Task); PopViewController(true); }); } else { for (int i = 0; i < NavigationBar.Subviews.Length; i++) { var child = NavigationBar.Subviews[i]; if (child.Alpha != 1) { UIView.Animate(.2f, () => child.Alpha = 1); } } } return(false); }
public static void NavigationBar (UINavigationBar v) { var borderImage = v.GetBorderImage (); if (borderImage != null) { borderImage.Hidden = true; } }
public override void ViewDidLoad () { base.ViewDidLoad (); NavBar=new UINavigationBar(new CoreGraphics.CGRect (0, 0, pview.uvWidth, 44)); NavBar.BackgroundColor = UIColor.Red; // UIBarButtonItem bbitemCancel = new UIBarButtonItem (UIBarButtonSystemItem.Cancel, CancelButtonClicked); UIButton btnCancel = new UIButton (new CGRect (0, 0, 80, 30)); btnCancel.SetTitleColor (UIColor.Blue, UIControlState.Normal); btnCancel.SetTitle ("Cancel", UIControlState.Normal); btnCancel.TouchUpInside += (object sender, EventArgs e) => { pview.popover.Dismiss(false); }; UIBarButtonItem bbitemCancel = new UIBarButtonItem (btnCancel); // UIBarButtonItem bbitemDone = new UIBarButtonItem (UIBarButtonSystemItem.Done, DoneButtonClicked); UIButton btnDone = new UIButton (new CGRect (0, 0, 80, 30)); btnDone.SetTitleColor (UIColor.Blue, UIControlState.Normal); btnDone.SetTitle ("Done", UIControlState.Normal); btnDone.TouchUpInside += (object sender, EventArgs e) => { pview.DismissPopOver (); }; UIBarButtonItem bbitemDone = new UIBarButtonItem (btnDone); UINavigationItem navgitem = new UINavigationItem ("Select"); navgitem.SetLeftBarButtonItem(bbitemCancel,true); navgitem.SetRightBarButtonItem (bbitemDone, true); NavBar.PushNavigationItem(navgitem,true); this.View.Add (NavBar); searchBar=new UISearchBar(new CoreGraphics.CGRect (0, 44, pview.uvWidth, 44)); this.View.Add(searchBar); rvc = new RootViewController (RootData,pview); rvc.View.Frame = new CoreGraphics.CGRect (0, 88, pview.uvWidth, 600); this.subview.SetRootview(rvc); this.View.Add (rvc.View); }
public override void ViewDidLoad() { base.ViewDidLoad (); _container = new UIView (); View.AddSubview (_container); _container.Frame = _container.Superview.Bounds; _container.BackgroundColor = UIColor.Gray; _imageView = new UIImageView (); _container.AddSubview (_imageView); _navigationBar = new UINavigationBar (); _navigationBar.Frame = new RectangleF (0f, 0f, 320f, 55f); _navigationBar.BarStyle = UIBarStyle.Default; UINavigationItem navItems = new UINavigationItem { LeftBarButtonItem = new UIBarButtonItem("Меню", UIBarButtonItemStyle.Plain, OnMenuButtonPressed) }; _navigationBar.Items = new UINavigationItem[] { navItems }; _container.AddSubview(_navigationBar); _sideBarMediator = new SideBarMediator(this, _container, _sideBar, 260f); SetImage(UIImage.FromFile("wishlist.png")); }
internal void SetupBackgroundView(UIView background) { BackgroundView.RemoveFromSuperview(); BackgroundView = background; if (BackgroundView == null) { BackgroundBlurringView.Hidden = true; } else { if (BackgroundBlurringView == null) { if (!IsLessThanIOS6) { BackgroundBlurringView = new UINavigationBar(Bounds); ((UINavigationBar)BackgroundBlurringView).BarStyle = UIBarStyle.Black; } else { BackgroundBlurringView = new UIView(Bounds); BackgroundBlurringView.BackgroundColor = UIColor.FromWhiteAlpha(0.0f, 0.75f); } BackgroundBlurringView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; InsertSubviewBelow(BackgroundBlurringView, ContentView); } BackgroundBlurringView.Hidden = false; BackgroundView.Frame = Bounds; BackgroundView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; InsertSubviewBelow(BackgroundView, BackgroundBlurringView); } }
Composer() : base(null, null) { // Navigation Bar navigationBar = new UINavigationBar (new RectangleF (0, 0, 320, 44)); navItem = new UINavigationItem (""); var close = new UIBarButtonItem (Locale.GetText ("Close"), UIBarButtonItemStyle.Plain, CloseComposer); navItem.LeftBarButtonItem = close; sendItem = new UIBarButtonItem (Locale.GetText ("Send"), UIBarButtonItemStyle.Plain, PostCallback); navItem.RightBarButtonItem = sendItem; navigationBar.PushNavigationItem (navItem, false); // Composer composerView = new ComposerView (ComputeComposerSize (RectangleF.Empty), this, CameraTapped); composerView.LookupUserRequested += delegate { PresentModalViewController (new UserSelector (userName => { composerView.Text += ("@" + userName + " "); }), true); }; // Add the views NSNotificationCenter.DefaultCenter.AddObserver ("UIKeyboardWillShowNotification", KeyboardWillShow); View.AddSubview (composerView); View.AddSubview (navigationBar); }
/// <summary> /// Applies a theme to the navigation bar. Note, this does not update the theme for the title. /// </summary> /// <param name="navigationBar">A navigation bar to apply the theme to.</param> /// <param name="theme">The theme to apply to the navigation bar.</param> public static void ApplyTheme(this UINavigationBar navigationBar, NavigationBarTheme theme) { UIColor backgroundColor = theme.BackgroundColor.ToUIColor(); navigationBar.BackgroundColor = backgroundColor; navigationBar.BarTintColor = backgroundColor; navigationBar.Translucent = theme.BackgroundColor.Alpha == 0; navigationBar.TintColor = theme.ItemColor.ToUIColor(); if (theme.ShadowColor.Alpha > 0) { nfloat height = 1.0f / UIScreen.MainScreen.Scale; UIView shadow = new UIView(new CGRect(0, navigationBar.Frame.Height, navigationBar.Frame.Width, height)); shadow.BackgroundColor = theme.ShadowColor.ToUIColor(); navigationBar.ShadowImage = null; navigationBar.AddSubview(shadow); } else { navigationBar.ShadowImage = new UIImage(); } UIStringAttributes attributes = new UIStringAttributes(); attributes.Font = ViewThemeExtensions.GetFont(theme.FontName, ViewFontSizes.LargeFontSize, FontStyle.Bold); attributes.ForegroundColor = theme.FontColor.ToUIColor(); navigationBar.TitleTextAttributes = attributes; }
public PatientDetailViewController(IObjectFactory objectFactory) { this.ObjectFactory = objectFactory; this.PatientManager = this.ObjectFactory.Create<IPatientManager>(); this.navBar = new UINavigationBar(new RectangleF(0,0,768, 44)); this.navBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.navBar.SetItems( new[] { new UINavigationItem("Patient Information") },false); this.navBar.TopItem.SetRightBarButtonItem(this.EditButtonItem, false); this.View.BackgroundColor = UIColor.LightGray; this.View.Frame = new RectangleF(0,0,768,768); this.patientDetailView = this.ObjectFactory.Create<PatientDetailView>(); this.patientDetailView.Frame = new RectangleF(0,44,this.colWidth1 + this.colWidth2, 728); this.patientDetailView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight; this.View.AddSubview (this.patientDetailView); this.View.AddSubview (this.navBar); }
public override void ViewDidLoad() { base.ViewDidLoad (); // no XIB ! navBar = new UINavigationBar(); navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false); navBar.BarStyle = UIBarStyle.Black; navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45); navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();}); tableView = new UITableView() { Delegate = new TableViewDelegate(this, _locations), DataSource = new TableViewDataSource(this, _locations), AutoresizingMask = UIViewAutoresizing.FlexibleHeight| UIViewAutoresizing.FlexibleWidth, Frame = new RectangleF (0, 45, this.View.Frame.Width, this.View.Frame.Height-44) , TableHeaderView = navBar, BackgroundColor = UIColor.Black, }; //quick hack to make cell text white foreach (var item in tableView.VisibleCells) { item.TextLabel.TextColor = UIColor.White; } // Set the table view to fit the width of the app. tableView.SizeToFit(); // Reposition and resize the receiver tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); // Add the table view as a subview this.View.AddSubview(tableView); }
public override void ViewDidLoad() { base.ViewDidLoad(); webView.ShouldStartLoad = delegate(UIWebView webViewParam, NSUrlRequest request, UIWebViewNavigationType navigationType) { // view links in a new 'webbrowser' window like session & twitter if (navigationType == UIWebViewNavigationType.LinkClicked) { this.NavigationController.PushViewController(new WebViewController(request), true); return(false); } return(true); }; navBar = new UINavigationBar(new RectangleF(0, 0, 320, 44)); var bbi = new UIBarButtonItem(UIImage.FromBundle("Images/slideout"), UIBarButtonItemStyle.Plain, (sender, e) => { AppDelegate.Current.FlyoutNavigation.ToggleMenu(); }); var item = new UINavigationItem("About MonkeySpace"); item.LeftBarButtonItem = bbi; var items = new UINavigationItem[] { item }; navBar.SetItems(items, false); View.Add(navBar); }
private void SetupTransparentNavigationBar(IList <ToolbarItem> toolbarItems) { var navBar = new UINavigationBar(new CGRect(0, 0, this.View.Bounds.Width, 60)) { Translucent = true }; navBar.SetBackgroundImage(new UIImage(), UIBarMetrics.Default); navBar.ShadowImage = new UIImage(); _navbarItem = new UINavigationItem { LeftBarButtonItems = new UIBarButtonItem[] { } }; var leftNativeButtons = new List <Tuple <ToolbarItem, UIBarButtonItem> >(); var rightNativeButtons = new List <Tuple <ToolbarItem, UIBarButtonItem> >(); _navbarItem.TitleView = BuildSubTitleView(NavigationBarPage); CreateUIBarButtonFromToolBarItems(leftNativeButtons, rightNativeButtons, toolbarItems); _navbarItem.RightBarButtonItems = SetCustomFontsToToolBars(rightNativeButtons, NavigationBarPage.RightToolbarItemFont, NavigationBarPage.RightToolbarItemVisible); _navbarItem.LeftBarButtonItems = SetCustomFontsToToolBars(leftNativeButtons, NavigationBarPage.LeftToolbarItemFont, NavigationBarPage.LeftToolbarItemVisible); if (NavigationBarPage.BarTintColor != Color.Default) { navBar.TintColor = NavigationBarPage.BarTintColor.ToUIColor(); } navBar.Items = new[] { _navbarItem }; this.View.AddSubview(navBar); }
/// <summary> /// Apply this theme to a specific view. /// </summary> /// <param name="options"> /// "blue", or null /// </para> public static void Apply(UINavigationBar view, string options = null) { if (options == "blue") view.SetBackgroundImage (blueNavigationBarBackground.Value, UIBarMetrics.Default); else view.SetBackgroundImage (navigationBarBackground.Value, UIBarMetrics.Default); }
void ReleaseDesignerOutlets() { if (lblBio != null) { lblBio.Dispose(); lblBio = null; } if (lblFollowers != null) { lblFollowers.Dispose(); lblFollowers = null; } if (lblFollowing != null) { lblFollowing.Dispose(); lblFollowing = null; } if (lblWelcome != null) { lblWelcome.Dispose(); lblWelcome = null; } if (Profile != null) { Profile.Dispose(); Profile = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); UIImageView backgroundView = new UIImageView(this.View.Bounds); backgroundView.Image = new UIImage("bg.png"); this.View.AddSubview(backgroundView); UINavigationBar navBar = new UINavigationBar(new CGRect(0, 0, this.View.Frame.Size.Width, 64)); UINavigationItem navItem = new UINavigationItem("SideDrawer"); UIBarButtonItem showSideDrawer = new UIBarButtonItem(new UIImage("menu.png"), UIBarButtonItemStyle.Plain, this, new Selector("ShowSideDrawer")); navItem.LeftBarButtonItem = showSideDrawer; navBar.Items = new UINavigationItem[] { navItem }; this.View.AddSubview(navBar); primarySection = new TKSideDrawerSection("Controls"); primarySection.AddItem("AppFeedback"); primarySection.AddItem("Calendar"); primarySection.AddItem("Chart"); primarySection.AddItem("DataSource"); primarySection.AddItem("ListView"); primarySection.AddItem("SideDrawer"); labelsSection = new TKSideDrawerSection("Help"); labelsSection.AddItem("Support"); labelsSection.AddItem("Documentation"); labelsSection.AddItem("Feedback"); this.SideDrawer = TKSideDrawer.FindSideDrawer(this); SideDrawer.AddSection(primarySection); SideDrawer.AddSection(labelsSection); }
public void GenerateUI() { bar = new UINavigationBar(new RectangleF(0, 0, 640, 70)); View.Add(bar); title = new UILabel(new RectangleF(0, 13, width, 50)); title.Text = "Las Vegas Bus Finder"; title.TextAlignment = UITextAlignment.Center; View.Add(title); refresh = new UIButton(UIButtonType.Custom); UIImage refreshIcon = UIImage.FromFile("refresh.png"); refresh.SetImage(refreshIcon, UIControlState.Normal); refresh.Frame = new RectangleF(width - 50, 25, 35, 35); refresh.TouchUpInside += delegate { RefreshClicked(); }; View.Add(refresh); refreshText = new UILabel(new RectangleF(0, 30, width, 50)); refreshText.Text = "Refreshed"; refreshText.TextAlignment = UITextAlignment.Center; refreshText.Font = UIFont.FromName("Helvetica", 12f); View.Add(refreshText); }
public PatientDetailViewController(IObjectFactory objectFactory) { this.ObjectFactory = objectFactory; this.PatientManager = this.ObjectFactory.Create <IPatientManager>(); this.navBar = new UINavigationBar(new RectangleF(0, 0, 768, 44)); this.navBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.navBar.SetItems( new[] { new UINavigationItem("Patient Information") }, false); this.navBar.TopItem.SetRightBarButtonItem(this.EditButtonItem, false); this.View.BackgroundColor = UIColor.LightGray; this.View.Frame = new RectangleF(0, 0, 768, 768); this.patientDetailView = this.ObjectFactory.Create <PatientDetailView>(); this.patientDetailView.Frame = new RectangleF(0, 44, this.colWidth1 + this.colWidth2, 728); this.patientDetailView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight; this.View.AddSubview(this.patientDetailView); this.View.AddSubview(this.navBar); }
public override void ViewDidLoad() { base.ViewDidLoad (); webView.ShouldStartLoad = delegate(UIWebView webViewParam, NSUrlRequest request, UIWebViewNavigationType navigationType) { // view links in a new 'webbrowser' window like session & twitter if (navigationType == UIWebViewNavigationType.LinkClicked) { this.NavigationController.PushViewController (new WebViewController (request), true); return false; } return true; }; navBar = new UINavigationBar (new RectangleF (0, 0, 320, 44)); var bbi = new UIBarButtonItem(UIImage.FromBundle ("Images/slideout"), UIBarButtonItemStyle.Plain, (sender, e) => { AppDelegate.Current.FlyoutNavigation.ToggleMenu(); }); var item = new UINavigationItem ("About MonkeySpace"); item.LeftBarButtonItem = bbi; var items = new UINavigationItem[] { item }; navBar.SetItems (items, false); View.Add (navBar); }
public override void ViewDidLoad() { base.ViewDidLoad(); base.TableView.DataSource = this.dataSource; // Note that images configured as the back bar button's background do // not have the current tintColor applied to them, they are displayed as it. var backButtonBackgroundImage = UIImage.FromBundle("Menu"); // The background should be pinned to the left and not stretch. backButtonBackgroundImage = backButtonBackgroundImage.CreateResizableImage(new UIEdgeInsets(0f, backButtonBackgroundImage.Size.Width - 1f, 0f, 0f)); var barAppearance = UINavigationBar.AppearanceWhenContainedIn(typeof(CustomBackButtonNavController)); barAppearance.BackIndicatorImage = backButtonBackgroundImage; barAppearance.BackIndicatorTransitionMaskImage = backButtonBackgroundImage; // Provide an empty backBarButton to hide the 'Back' text present by // default in the back button. // // NOTE: You do not need to provide a target or action. These are set // by the navigation bar. // NOTE: Setting the title of this bar button item to ' ' (space) works // around a bug in iOS 7.0.x where the background image would be // horizontally compressed if the back button title is empty. var backBarButton = new UIBarButtonItem(" ", UIBarButtonItemStyle.Plain, null); base.NavigationItem.BackBarButtonItem = backBarButton; }
public static UIBarButtonItem[] GetNavBarItems(this UINavigationBar navBar) { var result = navBar.Items .SelectMany(navItem => navItem.GetNavItemBarItems()) .ToArray(); return(result); }
private void FullyConstraintTopLayouts(UIView subview, UINavigationBar navigationBar) { subview.TranslatesAutoresizingMaskIntoConstraints = false; subview.LeftAnchor.ConstraintEqualTo(navigationBar.LeftAnchor).Active = true; subview.RightAnchor.ConstraintEqualTo(navigationBar.RightAnchor).Active = true; subview.TopAnchor.ConstraintEqualTo(navigationBar.TopAnchor, -navigationBar.Frame.Y).Active = true; subview.BottomAnchor.ConstraintEqualTo(navigationBar.BottomAnchor).Active = true; }
public void InitWithFrame() { RectangleF frame = new RectangleF(10, 10, 100, 100); using (UINavigationBar nb = new UINavigationBar(frame)) { Assert.That(nb.Frame, Is.EqualTo(frame), "Frame"); } }
public void BackgroundImage() { // http://stackoverflow.com/q/10504966/220643 using (UINavigationBar nb = new UINavigationBar()) { Assert.Null(nb.GetBackgroundImage(UIBarMetrics.Default), "Get"); nb.SetBackgroundImage(null, UIBarMetrics.Default); } }
public ToolBarBackView(UINavigationItem navigationItem, UINavigationBar navigationBar) { _navigationItem = navigationItem; _navigationBar = navigationBar; _backButton = new UIBarButtonItem(new UIImage(), UIBarButtonItemStyle.Plain, (sender, e) => { Presenter.BackClick(); }); _navigationItem.SetLeftBarButtonItem(_backButton, true); }
public static void SetTheme(this UINavigationBar navigationBar, string background, string fontStyle, string textColor, string textSize) { navigationBar.BarTintColor = _nativeTheme.Colors[background]; navigationBar.TitleTextAttributes = new UIStringAttributes() { Font = FontStyleFromEnum(_themeModel.FontStyles[fontStyle], _nativeTheme.FontSizes[textSize]), ForegroundColor = _nativeTheme.Colors[textColor], }; }
protected virtual bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { if (ViewControllers.Length < navigationBar.Items.Length) { return(true); } PopViewController(true); return(false); }
private static void SetApperance(UINavigationBar.UINavigationBarAppearance bar, UIImage backgroundImg, UIColor color) { bar.TintColor = UIColor.White; bar.BarTintColor = bar.BackgroundColor = color; bar.SetBackgroundImage(backgroundImg, UIBarMetrics.Default); bar.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.White, Font = UIFont.SystemFontOfSize(18f) }); bar.BackIndicatorImage = Images.Buttons.Back; bar.BackIndicatorTransitionMaskImage = Images.Buttons.Back; }
public static void NavigationBar(UINavigationBar v) { var borderImage = v.GetBorderImage(); if (borderImage != null) { borderImage.Hidden = true; } }
public static void SetupStyle(this UINavigationBar view, Models.ThemeConfigs.NavigationBar model) { view.BarTintColor = model.BackgroundColor.ToUIColor(); view.TintColor = model.TintColor.ToUIColor(); if (UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { view.PrefersLargeTitles = model.PrefersLargeTitles; if (model.LargeTitle != null && view.PrefersLargeTitles) { view.LargeTitleTextAttributes = new UIStringAttributes { Font = (UIFont)model.LargeTitle.Font ?? UIFont.GetPreferredFontForTextStyle(UIFontTextStyle.LargeTitle), ForegroundColor = model.LargeTitle.TextColor.ToUIColor(), KerningAdjustment = model.LargeTitle.Kerning ?? 0 } } ; view.Opaque = model.Opaque; view.Translucent = model.Translucent; if (!model.Translucent) { view.SetBackgroundImage(model.BackgroundColor.ToUIImage(), UIBarPosition.Any, UIBarMetrics.Default); view.ShadowImage = model.BackgroundColor.ToUIImage(); } else { view.BackgroundColor = model.BackgroundColor.ToUIColor(); view.ShadowImage = new UIImage(); view.SetBackgroundImage(null, UIBarMetrics.Default); } } else { view.SetBackgroundImage(model.BackgroundColor.ToUIImage(), UIBarPosition.Any, UIBarMetrics.Default); view.ShadowImage = model.BackgroundColor.ToUIImage(); view.Translucent = false; view.Opaque = false; } if (model.Title != null) { view.TitleTextAttributes = new UIStringAttributes { Font = (UIFont)model.Title.Font, ForegroundColor = model.Title.TextColor.ToUIColor(), KerningAdjustment = model.Title.Kerning ?? 0 } } ; } } }
public bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { // this means the pop is already done, nothing we can do if (ViewControllers.Length < NavigationBar.Items.Length) { return(true); } foreach (var tracker in _trackers) { if (tracker.Value.ViewController == TopViewController) { var behavior = Shell.GetBackButtonBehavior(tracker.Value.Page); var command = behavior.GetPropertyIfSet <ICommand>(BackButtonBehavior.CommandProperty, null); var commandParameter = behavior.GetPropertyIfSet <object>(BackButtonBehavior.CommandParameterProperty, null); if (command != null) { if (command.CanExecute(commandParameter)) { command.Execute(commandParameter); } return(false); } break; } } bool allowPop = ShouldPop(); if (allowPop) { // Do not remove, wonky behavior on some versions of iOS if you dont dispatch CoreFoundation.DispatchQueue.MainQueue.DispatchAsync(() => { _popCompletionTask = new TaskCompletionSource <bool>(); SendPoppedOnCompletion(_popCompletionTask.Task); PopViewController(true); }); } else { for (int i = 0; i < NavigationBar.Subviews.Length; i++) { var child = NavigationBar.Subviews[i]; if (child.Alpha != 1) { UIView.Animate(.2f, () => child.Alpha = 1); } } } return(false); }
public static void AdaptForIos10(this NSLayoutConstraint self, UINavigationBar navigationBar) { //on iOS 11 and later this happens automatically if (!UIDevice.CurrentDevice.CheckSystemVersion(11, 0)) { var statusbarHeight = UIApplication.SharedApplication.StatusBarFrame.Height; var navigationBarHeight = navigationBar == null ? 0 : navigationBar.Frame.Height; self.Constant += statusbarHeight + navigationBarHeight; } }
public override void ViewDidLoad() { base.ViewDidLoad (); navBar = new UINavigationBar(); navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false); navBar.BarStyle = UIBarStyle.Black; navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45); navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();}); tableView.TableHeaderView = navBar; tableView.Source = new TableViewSource(this, locations); }
public void EnableHideNavBarOnSwype(UINavigationBar navigationBar, UIScrollView scrollView, bool setupContentInset = true) { _navigationBar = navigationBar; if (setupContentInset) { var offset = _navigationBar.Frame.Height + _topOffsetOfNavBar; scrollView.ContentInset = new UIEdgeInsets(offset, 0, offset, 0); scrollView.ScrollIndicatorInsets = new UIEdgeInsets(offset, 0, offset, 0); } }
/// <summary> /// Apply this theme to a specific view. /// </summary> /// <param name="options"> /// "blue", or null /// </para> public static void Apply(UINavigationBar view, string options = null) { if (options == "blue") { view.SetBackgroundImage(blueNavigationBarBackground.Value, UIBarMetrics.Default); } else { view.SetBackgroundImage(navigationBarBackground.Value, UIBarMetrics.Default); } }
public bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { if (this.isGoingBack && this.ViewControllers.Length < navigationBar.Items.Length) { this.isGoingBack = false; return true; } this.GoBack(); return false; }
void ReleaseDesignerOutlets() { if (btnMyPosition != null) { btnMyPosition.Dispose (); btnMyPosition = null; } if (uiNavBar != null) { uiNavBar.Dispose (); uiNavBar = null; } }
bool navigationBarShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { if (dontPopWhileYouPop) return true; RxApp.MainThreadScheduler.Schedule (() => { if (!router.NavigateBack.CanExecute(null) || dontPopWhileYouPop) return; dontPopWhileYouPop = true; router.NavigateBack.Execute(null); }); return false; }
private void SetSessionBackground (UINavigationBar navigationBar) { var version = Convert.ToDecimal (UIDevice.CurrentDevice.SystemVersion.Split ('.').First ()); if (version >= 7) { navigationBar.SetBackgroundImage (UIImage.FromFile ("images/SessionsHeader3.png"), UIBarMetrics.Default); } else if (version >= 5) { navigationBar.SetBackgroundImage (UIImage.FromFile ("images/SessionsHeader2.png"), UIBarMetrics.Default); } else { navigationBar.InsertSubview (new UIImageView (UIImage.FromFile ("images/SessionsHeader2.png")), 0); } }
/// <summary> /// Apply this theme to all views with the given appearance. /// </summary> /// <param name="options"> /// "blue", or null /// </para> public static void Apply (UINavigationBar.UINavigationBarAppearance appearance, string options = null) { if (options == "blue") appearance.SetBackgroundImage (blueNavigationBarBackground.Value, UIBarMetrics.Default); else appearance.SetBackgroundImage (navigationBarBackground.Value, UIBarMetrics.Default); appearance.SetTitleTextAttributes (new UITextAttributes { TextColor = UIColor.FromRGBA (255, 255, 255, 255), TextShadowColor = UIColor.FromRGBA (0, 0, 0, 0.8f), TextShadowOffset = new UIOffset (0, -1) }); }
private void InitNavBar() { _navBar = new UINavigationBar(); _navBar.Frame = NavbarFrame; _navBar.ClipsToBounds = true; UIBarButtonItem _backBtnItem = new UIBarButtonItem("Сканировать еще", UIBarButtonItemStyle.Plain, OnBackPressed); _backNavItem = new UINavigationItem(); _backNavItem.LeftBarButtonItem = _backBtnItem; _navBar.SetItems(new UINavigationItem[] { _backNavItem }, false); }
public static void SetFlatNavigationBarAppearance(UINavigationBar.UINavigationBarAppearance appearance, UIColor color, UIColor textColor) { UIImage backgroundImage = FlatUI.Image(color, 0); appearance.SetBackgroundImage(backgroundImage, UIBarMetrics.Default); appearance.SetBackgroundImage(backgroundImage, UIBarMetrics.LandscapePhone); UITextAttributes titleTextAttributes = appearance.GetTitleTextAttributes(); if (titleTextAttributes == null) titleTextAttributes = new UITextAttributes(); titleTextAttributes.TextShadowColor = UIColor.Clear; titleTextAttributes.TextShadowOffset = new UIOffset(0, 0); titleTextAttributes.TextColor = textColor; titleTextAttributes.Font = FlatUI.BoldFontOfSize(0); appearance.SetTitleTextAttributes(titleTextAttributes); if (appearance.RespondsToSelector(new MonoTouch.ObjCRuntime.Selector("setShadowImage:"))) appearance.ShadowImage = FlatUI.Image(UIColor.Clear, 0); }
public override void ViewDidLoad() { base.ViewDidLoad (); // no XIB ! navBar = new UINavigationBar(); navBar.PushNavigationItem (new UINavigationItem("Choose Location"), false); navBar.BarStyle = UIBarStyle.Black; navBar.Frame = new RectangleF(0,0,this.View.Frame.Width,45); navBar.TopItem.RightBarButtonItem = new UIBarButtonItem("Done",UIBarButtonItemStyle.Bordered, delegate {FlipController.Flip();}); tableView = new UITableView() { Delegate = new TableViewDelegate(this, _locations), DataSource = new TableViewDataSource(this, _locations), AutoresizingMask = UIViewAutoresizing.FlexibleHeight| UIViewAutoresizing.FlexibleWidth, Frame = new RectangleF (0, 45, this.View.Frame.Width, this.View.Frame.Height-44) , TableHeaderView = navBar }; // Set the table view to fit the width of the app. tableView.SizeToFit(); // Reposition and resize the receiver tableView.Frame = new RectangleF (0, 0, this.View.Frame.Width, this.View.Frame.Height); // Add the table view as a subview this.View.AddSubview(tableView); /* Console.WriteLine("make flip button"); var flipButton = UIButton.FromType(UIButtonType.InfoDark); flipButton.Frame = new RectangleF(290,10,20,20); flipButton.Title (UIControlState.Normal); flipButton.TouchDown += delegate { FlipController.Flip(); }; Console.WriteLine("flipbutton created"); this.View.AddSubview(flipButton); */ }
public override void ViewDidLoad() { base.ViewDidLoad (); this.NavigationController.InteractivePopGestureRecognizer.Enabled = false; this.SideDrawerView = new TKSideDrawerView (this.View.Bounds); this.SideDrawerView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; this.View.AddSubview (this.SideDrawerView); UIImageView backgroundView = new UIImageView (this.SideDrawerView.MainView.Bounds); backgroundView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; backgroundView.Image = new UIImage ("sdk-examples-bg.png"); this.SideDrawerView.MainView.AddSubview (backgroundView); UINavigationBar navBar = new UINavigationBar (new CGRect (0, 0, this.SideDrawerView.MainView.Bounds.Width, 44)); navBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; this.NavItem = new UINavigationItem (); UIBarButtonItem showSideDrawer = new UIBarButtonItem (new UIImage ("menu.png"), UIBarButtonItemStyle.Plain, this, new Selector ("ShowSideDrawer")); this.NavItem.LeftBarButtonItem = showSideDrawer; navBar.Items = new UINavigationItem[] { this.NavItem }; this.SideDrawerView.MainView.AddSubview (navBar); primarySection = new TKSideDrawerSection ("Primary"); primarySection.AddItem ("Social"); primarySection.AddItem ("Promotions"); labelsSection = new TKSideDrawerSection ("Labels"); labelsSection.AddItem ("Important"); labelsSection.AddItem ("Starred"); labelsSection.AddItem ("Sent Mail"); labelsSection.AddItem ("Drafts"); this.sideDrawerDelegate = new SideDrawerDelegate (); TKSideDrawer sideDrawer = this.SideDrawerView.SideDrawer; sideDrawer.HeaderView = new SideDrawerHeader (true, this, new Selector ("DismissSideDrawer")); sideDrawer.AddSection (primarySection); sideDrawer.AddSection (labelsSection); sideDrawer.Delegate = this.sideDrawerDelegate; sideDrawer.Style.HeaderHeight = 44; }
public override void LoadView() { base.LoadView(); BarTintPlaceholder = new UIView(new CoreGraphics.CGRect(0,0, this.View.Bounds.Height, 20)); BarTintPlaceholder.BackgroundColor = UIColor.FromRGB(0.2745f, 0.3451f, 0.4157f); FavoriteCatTableView = new UITableView(); FavoriteCatTableView.BackgroundColor = ColorScheme.Clouds; myNavBar = new UINavigationBar(new CoreGraphics.CGRect(0,20,this.View.Bounds.Width, 44)); myNavBar.BackgroundColor = ColorScheme.WetAsphalt; NavBarItem = new UINavigationItem("Favorite Categories"); this.View.AddSubviews(new UIView[]{BarTintPlaceholder, FavoriteCatTableView, myNavBar}); FavoriteCatTableView.TranslatesAutoresizingMaskIntoConstraints = false; this.View.AddConstraints(new NSLayoutConstraint[]{ NSLayoutConstraint.Create(FavoriteCatTableView, NSLayoutAttribute.Top, NSLayoutRelation.Equal, myNavBar, NSLayoutAttribute.Bottom, 1, 0), NSLayoutConstraint.Create(FavoriteCatTableView, NSLayoutAttribute.Left, NSLayoutRelation.Equal, this.View, NSLayoutAttribute.Left, 1, 0), NSLayoutConstraint.Create(FavoriteCatTableView, NSLayoutAttribute.Right, NSLayoutRelation.Equal, this.View, NSLayoutAttribute.Right, 1, 0), NSLayoutConstraint.Create(FavoriteCatTableView, NSLayoutAttribute.Bottom, NSLayoutRelation.Equal, this.View, NSLayoutAttribute.Bottom, 1, 0), }); }
public SessionSpeakersMasterDetail(int speakerID) { speakerId = speakerID; navBar = new UINavigationBar(new RectangleF(0,0,768, 44)); navBar.SetItems(new UINavigationItem[]{new UINavigationItem("Session & Speaker Info")},false); View.BackgroundColor = UIColor.LightGray; View.Frame = new RectangleF(0,0,768,768); sessionView = new SessionView(this); sessionView.Frame = new RectangleF(0,44,colWidth1,728); sessionView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight; speakerView = new SpeakerView(-1); speakerView.Frame = new RectangleF(colWidth1+1,44,colWidth2,728); speakerView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; View.AddSubview (speakerView); View.AddSubview (sessionView); View.AddSubview (navBar); }
public IPhoneUIViewController(string title, string backButtonText) { contentView = new UIView(); contentView.Frame = new CGRect(new CGPoint(0,0),new CGSize(this.View.Frame.Size.Width, this.View.Frame.Size.Height)); contentView.BackgroundColor = UIColor.White; contentView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; UIBarButtonItem backButton = new UIBarButtonItem(); backButton.Title=backButtonText; backButton.Style = UIBarButtonItemStyle.Bordered; backButton.Clicked += delegate(object sender, EventArgs e) { UIApplication.SharedApplication.InvokeOnMainThread (delegate { UIView[] subviews = this.View.Subviews; foreach(UIView subview in subviews) { if(subview.GetType() == typeof(UIWebView) ) { UIWebView webView = (UIWebView) subview; //clean webview by loading a blank page (prevent video players keep playing after view controller closes) webView.LoadHtmlString("<html></html>", new NSUrl("/")); } } IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().DismissModalViewController(true); }); }; UINavigationItem navItem = new UINavigationItem(title); navItem.LeftBarButtonItem = backButton; UINavigationBar toolBar = new UINavigationBar(); toolBar.Frame = new CGRect(new CGPoint(0,0), new CGSize(this.View.Frame.Size.Width, this.GetNavigationBarHeight())); toolBar.PushNavigationItem(navItem, false); toolBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; contentView.AddSubview(toolBar); this.View = contentView; this.ModalPresentationStyle = UIModalPresentationStyle.FullScreen; this.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical; this.ModalInPopover = true; }
//, UIViewController speakerView) public SpeakerSessionMasterDetail(int speakerID) { speakerId = speakerID; navBar = new UINavigationBar(new RectangleF(0,0,768, 44)); navBar.SetItems(new UINavigationItem[]{new UINavigationItem("Speaker & Session Info")},false); View.BackgroundColor = UIColor.LightGray; View.Frame = new RectangleF(0,0,768,768); speakerView = new SpeakerView(-1); speakerView.Frame = new RectangleF(0,44,colWidth1,728); speakerView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight; sessionView = new SessionView(false); sessionView.Frame = new RectangleF(colWidth1+1,44,colWidth2,728); sessionView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth; View.AddSubview (speakerView); View.AddSubview (sessionView); View.AddSubview (navBar); // if (_speakerID > 1) // { // var speaker = BL.Managers.SpeakerManager.GetSpeaker (_speakerID); // var _sessions = BL.Managers.SessionManager.GetSessions (); // if (_sessions != null) // { // _session = (from session in _sessions // where session.SpeakerNames.IndexOf(speaker.Name) >= 0 // select session).FirstOrDefault(); // } // // _sessionView = new SessionView(_session); // _ssv.Frame = new RectangleF(colWidth1+1,0,colWidth2,728); // // this.View.AddSubview (_ssv); // } }
/// <summary> /// Construct the UI /// </summary> public override void LoadView() { UIWindow appWindow = UIApplication.SharedApplication.Delegate.Window; float titlebarHeight = 45F; float appHeight = appWindow.Frame.Size.Height; float appWidth = appWindow.Frame.Size.Width; RectangleF frame = new RectangleF (0F, 0F, appWidth, appHeight); topView = new UIView (frame); topView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; RectangleF barFrame = new RectangleF (0F, 0F, appWidth, titlebarHeight); titleBar = new UINavigationBar (barFrame); titleBar.BarStyle = UIBarStyle.Black; titleBar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth; RectangleF webviewFrame = new RectangleF (0F, titlebarHeight, appWidth, appHeight - titleBar.Frame.Size.Height); webView = new UIWebView (webviewFrame); webView.ScalesPageToFit = true; RectangleF activityFrame = new RectangleF(appWidth/2 - 12.5f, appHeight/2 -12.5f, 25F, 25F); activityView = new UIActivityIndicatorView (activityFrame); activityView.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray; activityView.SizeToFit (); activityView.AutoresizingMask = UIViewAutoresizing.FlexibleLeftMargin | UIViewAutoresizing.FlexibleRightMargin | UIViewAutoresizing.FlexibleTopMargin | UIViewAutoresizing.FlexibleBottomMargin; topView.AddSubview (titleBar); topView.AddSubview (activityView); topView.AddSubview (webView); UINavigationItem titleBarItem = new UINavigationItem ("Login"); UIBarButtonItem done = new UIBarButtonItem ("Close", UIBarButtonItemStyle.Done, delegate (object sender, EventArgs e) { cancelled = true; CloseView(); }); titleBarItem.SetLeftBarButtonItem (done, true); titleBar.PushNavigationItem (titleBarItem, true); this.View = topView; }
public override void DidPopItem (UINavigationBar navigationBar, UINavigationItem item) { // TODO: Implement - see: http://go-mono.com/docs/index.aspx?link=T%3aMonoTouch.Foundation.ModelAttribute }
protected virtual bool ShouldPopItem(UINavigationBar navigationBar, UINavigationItem item) { if (ViewControllers.Length < navigationBar.Items.Length) return true; PopViewController(true); return false; }
protected void Awake() { navigationBar = this; }
protected virtual void DidPopItem(UINavigationBar navigationBar, UINavigationItem item) { RaiseDidPopViewController(); }
public override bool ShouldPushItem (UINavigationBar navigationBar, UINavigationItem item) { // TODO: Implement - see: http://go-mono.com/docs/index.aspx?link=T%3aMonoTouch.Foundation.ModelAttribute return true; }