// // 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) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); tabBar = new UITabBarController(); MyMoney = new Money(); var CoffeeViewController = new Coffee(MyMoney); var ShoppingViewController = new Shopping(MyMoney); var MovieViewController = new Movie(MyMoney); var TotalViewController = new Total(MyMoney); tabBar.ViewControllers = new UIViewController[] { CoffeeViewController, ShoppingViewController, MovieViewController, TotalViewController }; // If you have defined a root view controller, set it here: window.RootViewController = tabBar; //make the window visible window.MakeKeyAndVisible(); return(true); }
public void Init(UIViewController vc) { _masterNavigationController = new UINavigationController(vc); if (_navStyle == MXTouchNavigationStyle.SplitViewOnPad && UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) { // toss a generic view in the detail pane _detailNavigationController = new UINavigationController(new SplashViewController(_initialViewImage)); _splitViewController = new SplitViewController(); _splitViewControllerDelegate = new SplitViewControllerDelegate(); _splitViewController.Delegate = _splitViewControllerDelegate; _splitViewController.ViewControllers = new UIViewController[2] { _masterNavigationController, _detailNavigationController }; this.View = _splitViewController.View; } else if (vc is UITabBarController) { _tabBarController = (vc as UITabBarController); this.View = vc.View; } else { // we are an iPhone, skip the split view and use the navigation controller instead! this.View = _masterNavigationController.View; } }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); root = new UIViewController (); vc1 = new ViewController1 (); root.View.AddSubview (vc1.View); vc1.InitialActionCompleted += (object sender, EventArgs e) => { vc1.View.RemoveFromSuperview (); tabController = new UITabBarController (); vc2 = new ViewController2 (); vc3 = new ViewController3 (); tabController.ViewControllers = new UIViewController[] { vc1, vc2, vc3 }; tabController.ViewControllers [0].TabBarItem.Title = "One"; tabController.ViewControllers [1].TabBarItem.Title = "Two"; tabController.ViewControllers [2].TabBarItem.Title = "Three"; root.AddChildViewController (tabController); root.Add (tabController.View); }; window.RootViewController = root; window.MakeKeyAndVisible (); return true; }
void goToScreen(string name) { UITabBarController tabBarController = (UITabBarController)Window.RootViewController; if (name == "2") { tabBarController.SelectedIndex = 1; } else { tabBarController.SelectedIndex = 0; UINavigationController nav = (UINavigationController)tabBarController.ViewControllers[0]; MainViewController controller = (MainViewController)nav.ViewControllers[0]; if (name == "1") { controller.PerformSegue("goToSettings", controller); } else if (name == "3") { controller.PerformSegue("goToProductsList", controller); } } }
private static IItemsSourceGenerator GetOrAddTabBarItemsSourceGenerator(UITabBarController controller) { var generator = controller.GetBindingMemberValue(AttachedMembers.UITabBarController.ItemsSourceGenerator); if (generator == null) { generator = new ArrayItemsSourceGenerator <UITabBarController, UIViewController>(controller, AttachedMemberConstants.ItemTemplate, (tabBarController, controllers) => { tabBarController.SetViewControllers(controllers, true); var viewController = tabBarController.SelectedViewController; if (viewController != null) { if ((controllers.Length == 0) || !controllers.Contains(viewController)) { viewController.RemoveFromParentViewController(); viewController.View?.RemoveFromSuperviewEx(); if (controllers.Length == 0) { tabBarController.SetBindingMemberValue( AttachedMembers.UITabBarController.SelectedItem, BindingExtensions.NullValue); } else { tabBarController.SelectedViewController = controllers.Last(); } } } }); controller.SetBindingMemberValue(AttachedMembers.UITabBarController.ItemsSourceGenerator, generator); } return(generator); }
static Task <UIViewController> GetVisibleViewController() { TaskCompletionSource <UIViewController> tcs = new TaskCompletionSource <UIViewController>(); Device.BeginInvokeOnMainThread(() => { try { UIViewController rootController = UIApplication.SharedApplication.KeyWindow.RootViewController; UINavigationController navigationController = rootController.PresentedViewController as UINavigationController; UITabBarController tabBarController = rootController.PresentedViewController as UITabBarController; if (navigationController != null) { tcs.SetResult(navigationController.TopViewController); } else if (tabBarController != null) { tcs.SetResult(tabBarController.SelectedViewController); } else if (rootController.PresentedViewController == null) { tcs.SetResult(rootController); } else { tcs.SetResult(rootController.PresentedViewController); } } catch (Exception ex) { tcs.SetException(ex); } }); return(tcs.Task); }
// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); tabBarController = new UITabBarController(); viewController1 = new MapStuff.MapLineSharp.MapLinesViewController(); viewController2 = new MapStuff.DrawMap.DrawGeometryMapViewController(); viewController1.TabBarItem = new UITabBarItem ("Show (OS3)", UIImage.FromFile("MapLineSharp/103-map.png"), 0); viewController2.TabBarItem = new UITabBarItem ("Draw (OS3)", UIImage.FromFile("DrawMap/72-pin.png"), 0); var v = new Version(UIDevice.CurrentDevice.SystemVersion); if (v.Major >= 4) { // create & use the iOS4 stuff viewController3 = new MapStuff.os4Maps.os4MapsViewController(); viewController3.TabBarItem = new UITabBarItem ("Show (OS4)", UIImage.FromFile("os4Maps/tabmap.png"), 0); tabBarController.ViewControllers = new UIViewController[] {viewController1, viewController2, viewController3}; } else { // otherwise just iOS3 tabBarController.ViewControllers = new UIViewController[] {viewController1, viewController2}; } window.AddSubview (tabBarController.View); window.MakeKeyAndVisible (); return true; }
// // 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) { // trace event TraceHelper.StartMessage("App: Loaded"); // if data isn't loaded from storage yet, load the app data if (!App.ViewModel.IsDataLoaded) { // Load app data from local storage (user creds, about tab data, constants, item types, folders, etc) App.ViewModel.LoadData(); } // create pages var add = new AddPage(); var calendar = new SchedulePage(); var folders = new UINavigationController(new FoldersViewController(UITableViewStyle.Plain)); var settings = new SettingsPage(); var more = new MoreViewController(); //var more = new UINavigationController(new MoreViewController()); tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController [] { add, calendar, folders, settings, more, }; tabBarController.ViewControllerSelected += (sender, e) => { UITabBarController v = (UITabBarController) sender; v.LoadView(); }; // if haven't synced with web service yet, try now if (initialSyncAlreadyHappened == false) { App.ViewModel.SyncWithService(); initialSyncAlreadyHappened = true; // if there's a home tab set, switch to it now var homeTab = PhoneSettingsHelper.GetHomeTab(App.ViewModel.PhoneClientFolder); if (homeTab != null && homeTab != "Add") SelectTab(homeTab); } // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); if (UIDevice.CurrentDevice.CheckSystemVersion(4, 0)) window.RootViewController = tabBarController; else window.AddSubview(tabBarController.View); window.MakeKeyAndVisible(); // trace exit TraceHelper.AddMessage("Exiting App Loaded"); return true; }
// // 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) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); var weatherController = new WeatherViewController(); var tweetsController = new TweetsViewController (); var statisticsController = new StatisticsViewController(); tabBarController = new UITabBarController (); tabBarController.TabBar.BackgroundImage = UIImage.FromBundle("tabBar_background"); tabBarController.TabBar.SelectionIndicatorImage = UIImage.FromBundle("tabBar_highlight" ); tabBarController.ViewControllers = new UIViewController [] { weatherController , tweetsController , statisticsController, }; tabBarController.TabBar.Items[0].SetFinishedImages(UIImage.FromBundle("weather" ), UIImage.FromBundle("weather" )); tabBarController.TabBar.Items[1].SetFinishedImages(UIImage.FromBundle("tweets" ), UIImage.FromBundle("tweets" )); tabBarController.TabBar.Items[2].SetFinishedImages(UIImage.FromBundle("statistics"), UIImage.FromBundle("statistics")); window.RootViewController = tabBarController; window.MakeKeyAndVisible (); App.ReloadData(); UILabel.Appearance.Font = App.GetFont(18); UISegmentedControl.Appearance.SetTitleTextAttributes(new UITextAttributes() { Font = App.GetFont(14) }, UIControlState.Normal); UITabBarItem .Appearance.SetTitleTextAttributes(new UITextAttributes() { Font = App.GetFont(11) }, UIControlState.Normal); return true; }
public void SetAppearance(UITabBarController controller, ShellAppearance appearance) { var background = appearance.BackgroundColor; var foreground = appearance.ForegroundColor; var unselectedColor = appearance.UnselectedColor; var tabBar = controller.TabBar; if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; _defaultUnselectedTint = tabBar.UnselectedItemTintColor; } if (!background.IsDefault) { tabBar.BarTintColor = BarAppearanceTrackerUtils.UnblendColor(background).ToUIColor(); } if (!foreground.IsDefault) { tabBar.TintColor = foreground.ToUIColor(); } if (!unselectedColor.IsDefault) { tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); } }
public virtual void SetAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor; var foregroundColor = appearanceElement.EffectiveTabBarForegroundColor; // Currently unused var disabledColor = appearanceElement.EffectiveTabBarDisabledColor; // Unused on iOS var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor; var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; bool operatingSystemSupportsUnselectedTint = Forms.IsiOS10OrNewer; if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; if (operatingSystemSupportsUnselectedTint) { _defaultUnselectedTint = tabBar.UnselectedItemTintColor; } } if (Forms.IsiOS15OrNewer) { UpdateiOS15TabBarAppearance(controller, appearance); } else { UpdateTabBarAppearance(controller, appearance); } }
public void createTabBarController() { if (!UIDevice.CurrentDevice.Name.Contains("Simulator")) // wtf is changed { if (UIDevice.CurrentDevice.CheckSystemVersion(8, 0)) { var pushSettings = UIUserNotificationSettings.GetSettingsForTypes(UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound, new NSSet()); UIApplication.SharedApplication.RegisterUserNotificationSettings(pushSettings); UIApplication.SharedApplication.RegisterForRemoteNotifications(); } else { UIRemoteNotificationType notificationTypes = UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound; UIApplication.SharedApplication.RegisterForRemoteNotificationTypes(notificationTypes); } } TabBarController = null; TabBarController = (UITabBarController)UIStoryboard.FromName("Main", null).InstantiateViewController("TabBarController"); TabBarController.SelectedIndex = 0; UITabBar.Appearance.BarTintColor = UIColor.Clear; TabBarController.Delegate = new TabBarDelegate(); //do not remove SDWebImageDownloader.SharedDownloader.SetHttpHeaderValue("Basic " + Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(string.Format("{0}:{1}", Globe.SharedInstance.User.username, Globe.SharedInstance.User.password))), "Authorization"); }
public override bool ShouldSelectViewController(UITabBarController tabBarController, UIViewController viewController) { UINavigationController navController = viewController as UINavigationController; Debug.WriteLine("TabBarControllerDelegate:ShouldSelectViewController"); if (navController.ViewControllers.Length == 0) { int index = Array.IndexOf(tabBarController.ViewControllers, viewController); if (index >= 0) { Type viewType = _parent._viewGroup.Items[index].ViewType; var modelType = MXContainer.Instance.Views.FirstOrDefault(v => v.Value == viewType).Key; string pattern = MXContainer.Instance.App.NavigationMap.GetPatternForModelType(modelType); MXContainer.Navigate(null, pattern); } } else { // do nothing, tab has a view, leave it for the contained view to figure out what needs // to be done } return(true); }
//Tab settings manager private void ManageTabBar(UITabBarController RootTab) { UITabBar tabBar = RootTab.TabBar; UITabBarItem t0 = tabBar.Items[0]; t0.Title = "Shop"; UIImage shop = UIImage.FromFile("shop.png"); shop = ResizeImage(shop, 32, 32); t0.Image = shop; t0.SelectedImage = shop; UITabBarItem t1 = tabBar.Items[1]; //t1 = new UITabBarItem(); t1.Title = "My Hangouts"; UIImage Taste = UIImage.FromFile("taste.png"); Taste = ResizeImage(Taste, 35, 35); t1.Image = Taste; t1.SelectedImage = Taste; UITabBarItem t2 = tabBar.Items[2]; t2.Title = "Explore"; UIImage explore = UIImage.FromFile("explore.png"); explore = ResizeImage(explore, 35, 35); t2.Image = explore; t2.SelectedImage = explore; t2.Enabled = true; //RootTab[2].RemoveFromParentViewController(); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { UINavigationBar.Appearance.SetBackgroundImage( UIImage.FromBundle("navigationBarBackground"), UIBarMetrics.Default); UINavigationBar.Appearance.SetTitleTextAttributes( new UITextAttributes() { TextColor = UIColor.Black }); profile = loadProfileWithPath(profilePath); window = new UIWindow(UIScreen.MainScreen.Bounds); UIViewController viewController1 = TTTPlayViewController.FromProfile(profile, profilePath); UIViewController viewController2 = TTTMessagesViewController.FromProfile(profile, profilePath); UIViewController viewController3 = TTTProfileViewController.FromProfile(profile, profilePath); UITabBarController tabBarController = new UITabBarController(); tabBarController.TabBar.BackgroundImage = UIImage.FromBundle("barBackground"); tabBarController.ViewControllers = new [] { viewController1, viewController2, viewController3 }; window.RootViewController = tabBarController; updateTintColor(); window.MakeKeyAndVisible(); NSNotificationCenter.DefaultCenter.AddObserver(TTTProfile.IconDidChangeNotification, iconDidChange); return(true); }
public override void ViewDidLoad () { base.ViewDidLoad (); MainBackButtonTmp.BackButtonClick = true; _tabController = this; _localizer = new Localizer (); CustomUIViewController tabVAC, tabILL, tabOVT, tabPOV, tabEXV; tabVAC = CreateTabViewController ("VAC", 0); tabILL = CreateTabViewController ("ILL", 1); tabOVT = CreateTabViewController ("OVT", 2); tabPOV = CreateTabViewController ("POV", 3); tabEXV = CreateTabViewController ("EXV", 4); var tabs = new CustomUIViewController[] { tabVAC, tabILL, tabOVT, tabPOV, tabEXV }; ViewControllers = tabs; SelectedViewController = tabVAC; _swipeRecognizerRight = new UISwipeGestureRecognizer (OnSwipeRight){ Direction = UISwipeGestureRecognizerDirection.Right }; _swipeRecognizerLeft = new UISwipeGestureRecognizer (OnSwipeLeft){ Direction = UISwipeGestureRecognizerDirection.Left }; View.AddGestureRecognizer (_swipeRecognizerRight); View.AddGestureRecognizer (_swipeRecognizerLeft); }
public InvoiceBottomView(UIViewController parent) { BackgroundColor = UIColor.LightGray; tabbar = new UITabBarController () { ViewControllers = new UIViewController[] { coupons = new QuickItemsViewController{ TabBarItem = new UITabBarItem ("Offers", UIImage.FromBundle ("coupon"), 0), ItemBackgroundColor = Color.Red, AlternateItemBackgroundColor = Color.Olive, Title = "Offers", Sections = 2, GetItems = WebService.Main.GetGroupedCoupons, AddItem = (i) =>{ if(AddItem != null) AddItem(i); }, }, newProduct = new QuickItemsViewController{ TabBarItem = new UITabBarItem ("New Product", UIImage.FromBundle ("newProduct"), 1), ItemBackgroundColor = Color.Orange, AlternateItemBackgroundColor = Color.Orange, Title = "New Product", GetItems = (s) => WebService.Main.GetNewProducts(), AddItem = (i) =>{ if(AddItem != null) AddItem(i); }, }, }, }; NotificationCenter.Shared.CouponsChanged += () => coupons.ReloadData (); NotificationCenter.Shared.NewProductChanged += () => newProduct.ReloadData (); AddSubview (tabbar.View); parent.AddChildViewController (tabbar); }
public virtual void SetAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor; var foregroundColor = appearanceElement.EffectiveTabBarForegroundColor; // Currently unused var disabledColor = appearanceElement.EffectiveTabBarDisabledColor; // Unused on iOS var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor; var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; _defaultUnselectedTint = tabBar.UnselectedItemTintColor; } if (PlatformVersion.IsAtLeast(15)) { UpdateiOS15TabBarAppearance(controller, appearance); } else { UpdateTabBarAppearance(controller, appearance); } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); root = new UIViewController(); vc1 = new ViewController1(); root.View.AddSubview(vc1.View); vc1.InitialActionCompleted += (object sender, EventArgs e) => { vc1.View.RemoveFromSuperview(); tabController = new UITabBarController(); vc2 = new ViewController2(); vc3 = new ViewController3(); tabController.ViewControllers = new UIViewController[] { vc1, vc2, vc3 }; tabController.ViewControllers [0].TabBarItem.Title = "One"; tabController.ViewControllers [1].TabBarItem.Title = "Two"; tabController.ViewControllers [2].TabBarItem.Title = "Three"; root.AddChildViewController(tabController); root.Add(tabController.View); }; window.RootViewController = root; window.MakeKeyAndVisible(); return(true); }
// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching(UIApplication app, NSDictionary options) { window = new UIWindow(UIScreen.MainScreen.Bounds); tabBarController = new UITabBarController(); viewController1 = new MapStuff.MapLineSharp.MapLinesViewController(); viewController2 = new MapStuff.DrawMap.DrawGeometryMapViewController(); viewController1.TabBarItem = new UITabBarItem("Show (OS3)", UIImage.FromFile("MapLineSharp/103-map.png"), 0); viewController2.TabBarItem = new UITabBarItem("Draw (OS3)", UIImage.FromFile("DrawMap/72-pin.png"), 0); var v = new Version(UIDevice.CurrentDevice.SystemVersion); if (v.Major >= 4) { // create & use the iOS4 stuff viewController3 = new MapStuff.os4Maps.os4MapsViewController(); viewController3.TabBarItem = new UITabBarItem("Show (OS4)", UIImage.FromFile("os4Maps/tabmap.png"), 0); tabBarController.ViewControllers = new UIViewController[] { viewController1, viewController2, viewController3 }; } else { // otherwise just iOS3 tabBarController.ViewControllers = new UIViewController[] { viewController1, viewController2 }; } window.AddSubview(tabBarController.View); window.MakeKeyAndVisible(); return(true); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); UITabBarController nav = (UITabBarController)Storyboard.InstantiateViewController("mainTabBar"); //this.NavigationController.PushViewController(nav, true); }
private void ManageTabBar(UITabBarController RootTab) { UITabBar tabBar = RootTab.TabBar; //UITabBar.Appearance.BackgroundColor = UIColor.Red; //UITabBar.Appearance.BackgroundImage = UIImage.FromFile("Star4.png"); UITabBarItem t0 = tabBar.Items[0]; t0.Title = "Shop"; UIImage shop = UIImage.FromFile("Shop.png"); shop = ResizeImage(shop, 32, 32); t0.Image = shop; t0.SelectedImage = shop; UITabBarItem t1 = tabBar.Items[1]; //t1 = new UITabBarItem(); t1.Title = "Taste"; UIImage Taste = UIImage.FromFile("taste.png"); Taste = ResizeImage(Taste, 35, 35); t1.Image = Taste; t1.SelectedImage = Taste; UITabBarItem t2 = tabBar.Items[2]; t2.Title = "Explore"; UIImage explore = UIImage.FromFile("explore.png"); explore = ResizeImage(explore, 35, 35); t2.Image = explore; t2.SelectedImage = explore; }
public virtual void SetAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor; var foregroundColor = appearanceElement.EffectiveTabBarForegroundColor; // currently unused var disabledColor = appearanceElement.EffectiveTabBarDisabledColor; // unused on iOS var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor; var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; _defaultUnselectedTint = tabBar.UnselectedItemTintColor; } if (!backgroundColor.IsDefault) { tabBar.BarTintColor = backgroundColor.ToUIColor(); } if (!titleColor.IsDefault) { tabBar.TintColor = titleColor.ToUIColor(); } if (!unselectedColor.IsDefault) { tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); } }
/// <summary> /// 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. /// </summary> /// <remarks> /// You have 5 seconds to return from this method, or iOS will terminate your application. /// </remarks> public override bool FinishedLaunching(UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); UIViewController viewController1, viewController2; if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) { viewController1 = new FirstViewController("FirstViewController_iPhone", null); viewController2 = new SecondViewController("SecondViewController_iPhone", null); } else { viewController1 = new FirstViewController("FirstViewController_iPad", null); viewController2 = new SecondViewController("SecondViewController_iPad", null); } tabBarController = new UITabBarController(); tabBarController.ViewControllers = new UIViewController [] { viewController1, viewController2, }; window.RootViewController = tabBarController; window.MakeKeyAndVisible(); return(true); }
public override bool ShouldSelectViewController(UITabBarController tabBarController, UIViewController viewController) { UINavigationController navController = viewController as UINavigationController; System.Console.WriteLine("TabBarControllerDelegate:ShouldSelectViewController"); if (navController.ViewControllers.Length == 0) { int index = Array.IndexOf(tabBarController.ViewControllers, viewController); if (index >= 0) { Type viewType = _parent._viewGroup.Items[index].ViewType; MXViewPerspective viewPerspective = MXContainer.Instance.Views.GetViewPerspectiveForViewType(viewType); string pattern = MXContainer.Instance.App.NavigationMap.GetPatternForModelType(viewPerspective.ModelType); MXTouchContainer.Navigate(null, pattern); } } else { // do nothing, tab has a view, leave it for the contained view to figure out what needs // to be done } return(true); }
void UpdateTabBarAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor; var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor; var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; if (backgroundColor != null) { tabBar.BarTintColor = backgroundColor.ToUIColor(); } if (titleColor.IsDefault != null) { tabBar.TintColor = titleColor.ToUIColor(); } bool operatingSystemSupportsUnselectedTint = Forms.IsiOS10OrNewer; if (operatingSystemSupportsUnselectedTint) { if (unselectedColor.IsDefault != null) { tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); } } }
protected override void OnElementChanged (VisualElementChangedEventArgs e) { base.OnElementChanged (e); if (e.NewElement != null) { tabbedController = (UITabBarController)ViewController; } if (!isInitialized) { rightGesture = new UISwipeGestureRecognizer (swipe => { //Check to make sure we aren't at the last view Console.WriteLine ("Swipe Left"); if(this.SelectedIndex != ViewControllers.Length - 1) tabbedController.SelectedViewController = ViewControllers [this.SelectedIndex + 1]; }) { Direction = UISwipeGestureRecognizerDirection.Left }; leftGesture = new UISwipeGestureRecognizer (swipe => { //Check to make sure we aren't at the first view Console.WriteLine ("Swipe Right"); if(this.SelectedIndex != 0) tabbedController.SelectedViewController = ViewControllers [this.SelectedIndex - 1]; }) { Direction = UISwipeGestureRecognizerDirection.Right }; View.AddGestureRecognizer (rightGesture); View.AddGestureRecognizer (leftGesture); isInitialized = true; } }
private static IItemsSourceGenerator GetOrAddTabBarItemsSourceGenerator(UITabBarController controller) { return(ServiceProvider .AttachedValueProvider .GetOrAdd(controller, TabBarItemsSourceKey, (barController, o) => new ArrayItemsSourceGenerator <UITabBarController, UIViewController>(barController, AttachedMemberConstants.ItemTemplate, (tabBarController, controllers) => { tabBarController.SetViewControllers(controllers, true); var viewController = tabBarController.SelectedViewController; if (viewController != null) { if (controllers.Length == 0 || !controllers.Contains(viewController)) { viewController.RemoveFromParentViewController(); if (viewController.View != null) { viewController.View.RemoveFromSuperviewEx(); } if (controllers.Length == 0) { TabBarSelectedItemMember.SetValue(tabBarController, BindingExtensions.NullValue); } else { tabBarController.SelectedViewController = controllers.Last(); } } } }), null)); }
public void SetAppearance(UITabBarController controller, ShellAppearance appearance) { IShellAppearanceElement appearanceElement = appearance; var backgroundColor = appearanceElement.EffectiveTabBarBackgroundColor; var unselectedColor = appearanceElement.EffectiveTabBarUnselectedColor; var titleColor = appearanceElement.EffectiveTabBarTitleColor; var tabBar = controller.TabBar; bool operatingSystemHasUnselectedTint = UIDevice.CurrentDevice.CheckSystemVersion(10, 0); if (_defaultTint == null) { _defaultBarTint = tabBar.BarTintColor; _defaultTint = tabBar.TintColor; if (operatingSystemHasUnselectedTint) { _defaultUnselectedTint = tabBar.UnselectedItemTintColor; } } if (!backgroundColor.IsDefault) { tabBar.BarTintColor = backgroundColor.ToUIColor(); } if (!titleColor.IsDefault) { tabBar.TintColor = titleColor.ToUIColor(); } if (operatingSystemHasUnselectedTint && !unselectedColor.IsDefault) { tabBar.UnselectedItemTintColor = unselectedColor.ToUIColor(); } }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { UINavigationBar.Appearance.SetBackgroundImage ( UIImage.FromBundle ("navigationBarBackground"), UIBarMetrics.Default); UINavigationBar.Appearance.SetTitleTextAttributes ( new UITextAttributes () { TextColor = UIColor.Black }); profile = loadProfileWithPath (profilePath); window = new UIWindow (UIScreen.MainScreen.Bounds); UIViewController viewController1 = TTTPlayViewController.FromProfile (profile, profilePath); UIViewController viewController2 = TTTMessagesViewController.FromProfile (profile, profilePath); UIViewController viewController3 = TTTProfileViewController.FromProfile (profile, profilePath); UITabBarController tabBarController = new UITabBarController (); tabBarController.TabBar.BackgroundImage = UIImage.FromBundle ("barBackground"); tabBarController.ViewControllers = new [] { viewController1, viewController2, viewController3 }; window.RootViewController = tabBarController; updateTintColor (); window.MakeKeyAndVisible (); NSNotificationCenter.DefaultCenter.AddObserver (TTTProfile.IconDidChangeNotification, iconDidChange); return true; }
public override bool ShouldSelectViewController(UITabBarController tabBarController, UIViewController viewController) { Console.WriteLine("SHOULD SELECT"); var screen = tabBarController.SelectedViewController as IDirty; if (screen == null) { return(true); } //else { // ctrl.MoreNavigationController.PopToRootViewController(false); //} if (screen.IsDirty && (screen as SrendipTabNavigationController).MenuItem.Equals(MenuItem.LogHours)) { ctrl.Confirm(Resources.AreYouSure, Resources.UnsavedChanges, null, ok => { if (ok) { screen.Cleanup(); ctrl.SelectedViewController = viewController; } }); return(false); } return(true); }
void DidRotate(NSNotification notification) { if (!IsViewLoaded) // we haven't even loaded up yet, let's turn away from this place { return; } if (notification == null) { return; } #if __UNIFIED__ UIInterfaceOrientation fromOrientation = (UIInterfaceOrientation) (((NSNumber)notification.UserInfo.ValueForKey(UIApplication.StatusBarOrientationUserInfoKey)).Int64Value); #else UIInterfaceOrientation fromOrientation = (UIInterfaceOrientation) (((NSNumber)notification.UserInfo.ValueForKey(UIApplication.StatusBarOrientationUserInfoKey)).IntValue); #endif UITabBarController tabBar = TabBarController; bool notModal = (tabBar.PresentedViewController == null); bool isSelectedTab = TabBarController.SelectedViewController == this; if (!isSelectedTab || !notModal) { // Looks like we're not "visible" ... propogate rotation info base.DidRotate(fromOrientation); } }
public UITabBarController GetTabBarController() { UITabBarController tabBarController = new UITabBarController(); tabBarController.TabBar.BarTintColor = UIColor.Black; return(tabBarController); }
public new void ViewControllerSelected(UITabBarController tabBarController, UIViewController viewController) { if (viewController is IScrollableViewController vc && vc == previousVC) { vc.ScrollsToTop(); } previousVC = viewController; }
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender) { base.PrepareForSegue (segue, sender); if (segue.Identifier == "Popular2Container") { Container = (UITabBarController)segue.DestinationViewController; Container.TabBar.Hidden = true; } }
public void Include(UITabBarController controller) { controller.ViewControllerSelected += (sender, e) => { var test = $"{sender}, {e.ViewController}, {e}"; }; controller.SelectedIndex = 1; }
public void Ctor_Nib() { using (UITabBarController c = new UITabBarController("EmptyNib", null)) { // `initWithNibName:bundle:` is defined on a base class so it does not // affect the fields from UITabBarController CheckDefault(c); } }
// // 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) { window = new UIWindow(UIScreen.MainScreen.Bounds); Util.VisualMode = VisualMode.None; //Util.VisualMode = VisualMode.TintColor; //Util.VisualMode = VisualMode.UIAppearance; AppearanceManager.SetAppearance(); UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque; tabBar = new UITabBarController(); loginDvc = new LoginDialogViewController(); //have a look at the ExpenseModel class to see why it's hard to do // theming on MonoTouch.Dialog auto-generated stuff var expense = new ExpenseModel(); var context = new BindingContext(null, expense, "Expenses"); expenseDvc = new BaseDialogViewController(context.Root); expenseDvc.Title = "Expenses"; var tabControllers = new UINavigationController[] { new UINavigationController(loginDvc) { TabBarItem = new UITabBarItem("Login", Resources.Padlock, 1) }, new UINavigationController(expenseDvc) { TabBarItem = new UITabBarItem("Expenses", Resources.Expense, 2) } /* new UINavigationController(deadlines) { TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2) }, new UINavigationController(reports) { TabBarItem = new UITabBarItem("Reports", Resources.Deadlines, 4) }, new UINavigationController(you) { TabBarItem = new UITabBarItem("You", Resources.You, 3) } */ }; tabBar.SetViewControllers(tabControllers, false); window.RootViewController = tabBar; window.MakeKeyAndVisible (); return true; }
protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); if (e.NewElement != null) { tabbedController = (UITabBarController)ViewController; } tab = (TabbedPage)e.NewElement; }
public void SetAppearance(UITabBarController controller, ShellAppearance appearance) { var layer = new CAShapeLayer(); layer.Path = CreatePath((float)(controller.TabBar.Frame.Width / 2), (float)controller.TabBar.Frame.Height); layer.FillColor = new CGColor(0.4f, 0.3f, 0.4f); controller.TabBar.Layer.InsertSublayer(layer, 0); }
void InitializeComponent() { // calculate the frame sizes float navBarHeight = new UINavigationController().NavigationBar.Bounds.Height; float tabBarHeight = new UITabBarController().TabBar.Bounds.Height; float availableHeight = View.Bounds.Height - navBarHeight - tabBarHeight; float toolbarHeight = navBarHeight; float tableHeight = availableHeight - toolbarHeight; // create the tableview TableView = new UITableView() { Frame = new RectangleF(0, 0, View.Bounds.Width, tableHeight) }; TableView.BackgroundColor = UIColorHelper.FromString(App.ViewModel.Theme.TableBackground); TableView.SeparatorColor = UIColorHelper.FromString(App.ViewModel.Theme.TableSeparatorBackground); this.View.AddSubview(TableView); // create the toolbar Toolbar = new UIToolbar() { Frame = new RectangleF(0, tableHeight, View.Bounds.Width, toolbarHeight) }; var flexSpace = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace); //var addButton = new UIBarButtonItem("\u2795" /* big plus */ + "List", UIBarButtonItemStyle.Plain, delegate { var addButton = new UIBarButtonItem(UIBarButtonSystemItem.Add, delegate { FolderEditor folderEditor = new FolderEditor(this.NavigationController, null); folderEditor.PushViewController(); }); var editButton = new UIBarButtonItem(UIBarButtonSystemItem.Edit); var doneButton = new UIBarButtonItem(UIBarButtonSystemItem.Done); editButton.Clicked += delegate { if (TableView.Editing == false) { TableView.SetEditing(true, true); Toolbar.SetItems(new UIBarButtonItem[] { flexSpace, addButton, flexSpace, doneButton, flexSpace }, false); } }; doneButton.Clicked += delegate { if (TableView.Editing == true) { TableView.SetEditing(false, true); Toolbar.SetItems(new UIBarButtonItem[] { flexSpace, addButton, flexSpace, editButton, flexSpace }, false); // trigger a sync with the Service App.ViewModel.SyncWithService(); } }; Toolbar.SetItems(new UIBarButtonItem[] { flexSpace, addButton, flexSpace, editButton, flexSpace }, false); this.View.AddSubview(Toolbar); }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { App_Window = new UIWindow (UIScreen.MainScreen.Bounds); Tab_Bar_Controller = new MyTabBarController(); App_Window.RootViewController = Tab_Bar_Controller; App_Window.MakeKeyAndVisible(); return true; }
public AppDelegateShared(UIWindow window, UITabBarController tabBarController, UIViewController loginController) { this.window = window; this.tabBarController = tabBarController; this.loginHeaderController = loginHeaderController; this.loginController = loginController; login = new Login(); previousWasServerConfig = false; }
private void AddNavigationController() { var tabBarController = new UITabBarController(); tabBarController.ViewControllers = new UIViewController[] { CreateController (@"Twitter", @"TabBar/icon_twitter.png"), CreateController (@"Dribbble", @"TabBar/icon_dribbble.png"), CreateController (@"Apple", @"TabBar/icon_apple.png"), CreateController (@"GitHub", @"TabBar/icon_github.png") }; window.RootViewController = tabBarController; }
// // 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) { // Appearance UITableView.Appearance.BackgroundColor = Styles.RTDarkerBlue; UITableView.Appearance.SeparatorInset = UIEdgeInsets.Zero; UITabBar.Appearance.BarTintColor = Styles.RTDarkerBlue; // create a new window instance based on the screen size window = new UIWindow(UIScreen.MainScreen.Bounds); var cs = new ConcurrencyService(); _cs = cs; var logSource = new LogHub(); _loggerFactory = new LoggerFactory(logSource); #if DEBUG UIApplication.CheckForIllegalCrossThreadCalls = true; var logViewController = new LogViewController(cs, logSource); #endif _reactiveTrader = new Adaptive.ReactiveTrader.Client.Domain.ReactiveTrader(); _startUpViewController = new StartUpView(Initalize); Initalize(); _notificationHandler = new NotificationGenerator(_reactiveTrader, cs); _notificationHandler.Initialise(); var tradesViewController = new TradesViewController(_reactiveTrader, cs); var pricesViewController = new PriceTilesViewController(_reactiveTrader, cs); var statusViewController = new StatusViewController(_reactiveTrader, cs, _notificationHandler.NotificationsEnabled); tabBarController = new UITabBarController(); tabBarController.ViewControllers = new UIViewController[] { pricesViewController, tradesViewController, statusViewController #if DEBUG , logViewController #endif }; tabBarController.ModalTransitionStyle = UIModalTransitionStyle.CrossDissolve; window.RootViewController = _startUpViewController; window.MakeKeyAndVisible(); new WormholeSender(_reactiveTrader); return true; }
private void InitializeTabController() { tabBarController = new UITabBarController(); tabBarController.SelectedIndex = 0; tabBarController.ViewControllers = new UIViewController[] { sessionsNavigationController, speakersNavigationController, myScheduleNavigationController, twitterNavigationController }; window.AddSubview(tabBarController.View); }
// // 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) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); UITabBarController tabBarController = new UITabBarController(); tabBarController.ViewControllers = new UIViewController[]{new UINavigationController(new DemoViewController())}; window.RootViewController = tabBarController; // make the window visible window.MakeKeyAndVisible (); return true; }
private UIViewController BuildGridDemo () { var tabs = new UITabBarController (); tabs.Title = "DSGridView"; var aView = new DSDemoGridViewController (); var aView2 = new DSDemoViewWithGridController (); var aView3 = new DSNetGridViewController (); tabs.ViewControllers = new UIViewController[]{ aView, aView2, aView3 }; return tabs; }
public void InitPhoneRootViewController () { tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController[] { new UINavigationController (new ProfileViewController ()), new UINavigationController (new WorkoutController ()), new UINavigationController (new ElementsViewController ()), new ExtraViewController () }; for (var i = 0; i < tabBarController.TabBar.Items.Length; i++) { var item = tabBarController.TabBar.Items[i]; FitpulseTheme.Apply (item, (ThemeTab)i); } }
private UITabBarController CreateTabController() { var tabController = new UITabBarController (); tabController.ViewControllers = new UIViewController[] { CreateController (UIColor.Purple, "Purple"), CreateController (UIColor.Blue, "Blue"), CreateController (UIColor.Brown, "Brown") }; foreach (var viewController in tabController.ViewControllers) { AddTabNavigationButtons (viewController, tabController.ViewControllers); } tabController.TabBarItem.Title = "Tabs"; return tabController; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { window = new UIWindow (UIScreen.MainScreen.Bounds); UITabBarController tabBarController = new UITabBarController (); tabBarController.SetViewControllers (new UIViewController[] { new GraphViewController ("Accelerometer", MotionDataType.AccelerometerData), new GraphViewController ("Gyro", MotionDataType.GyroData), new GraphViewController ("DeviceMotion", MotionDataType.DeviceMotion) }, true); window.RootViewController = tabBarController; window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { tabs = new UITabBarController (); tabs.SetViewControllers (new UIViewController[] { new UINavigationController (new HomeController ()), new UINavigationController (new PhotosController ()), new UINavigationController (new ProfileController ()), new UINavigationController (new CirclesController ()), }, false); window.AddSubview (tabs.View); window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching(UIApplication app, NSDictionary options) { FileAccessHelper.GetFilePath("phrasebook.db3"); window = new UIWindow(UIScreen.MainScreen.Bounds); window.MakeKeyAndVisible(); phraseViewController = new CategoryScreen(); informationViewController = new InformationScreen(); iwaidjaInymanViewController = new IwaidjaInymanScreen (); //Phrase screen navigationController = new UINavigationController(); navigationController.PushViewController(phraseViewController, true); navigationController.TabBarItem = new UITabBarItem ("Phrases", null, 0); UIImage phraseTabImage = UIImage.FromFile ("Images/Phrases"); navigationController.TabBarItem.Image = scaleToSize (phraseTabImage, 30.0f, 30.0f); //Information screen informationNavigationController = new UINavigationController (); informationNavigationController.PushViewController (informationViewController, true); informationNavigationController.TabBarItem = new UITabBarItem ("Information", null, 1); UIImage informationTabImage = UIImage.FromFile ("Images/Information"); informationNavigationController.TabBarItem.Image = scaleToSize (informationTabImage, 30.0f, 30.0f); //Iwaidja screen iwaidjaInymanNavigationController = new UINavigationController(); iwaidjaInymanNavigationController.PushViewController (iwaidjaInymanViewController, true); iwaidjaInymanNavigationController.TabBarItem = new UITabBarItem ("Yagbani", null, 2); UIImage iwaidjaInymanTabImage = UIImage.FromFile ("Images/IwaidjaInyman"); iwaidjaInymanNavigationController.TabBarItem.Image = scaleToSize (iwaidjaInymanTabImage, 30.0f, 30.0f); tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController[] { navigationController, informationNavigationController, iwaidjaInymanNavigationController }; tabBarController.TabBar.BarTintColor = UIColor.White; tabBarController.TabBar.TintColor = UIColor.White; tabBarController.TabBar.SelectionIndicatorImage = CreateImageFromColor (tabBarController.TabBar.Frame.Size.Height, tabBarController.TabBar.Frame.Size.Width); window.RootViewController = tabBarController; return true; }
// // 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) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); ThemeManager.ApplyTheme (); var tabs = new UITabBarController (); UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque; var firstdvc = BuildDialogViewController (); firstdvc.NavigationItem.RightBarButtonItems = new [] { new UIBarButtonItem(UIBarButtonSystemItem.Add, delegate {}), new UIBarButtonItem(UIBarButtonSystemItem.Done, delegate {}) }; var tabControllers = new UINavigationController[] { new UINavigationController(firstdvc) { TabBarItem = new UITabBarItem("First", Theme.Resources.TempIcon, 1) }, new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain)) { TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1) }, new UINavigationController(BuildControlsDialogViewController()) { TabBarItem = new UITabBarItem("Controls", Theme.Resources.TempIcon, 1) }, new UINavigationController(BuildDialogViewController(style: UITableViewStyle.Plain)) { TabBarItem = new UITabBarItem("Second", Theme.Resources.TempIcon, 1) } }; tabs.SetViewControllers (tabControllers, false); // If you have defined a root view controller, set it here: window.RootViewController = tabs; // make the window visible window.MakeKeyAndVisible (); return true; }
public void ApplicationStartUpMode(AppMode mode) { switch (mode) { case AppMode.Login: Console.WriteLine("Launching login mode..."); InvokeOnMainThread(()=>{ _loginViewController.View.Frame = ScreenResolutionMatcher.FullViewFrame(); _RemoveAllSubviews(); window.AddSubview(_loginViewController.View); }); break; case AppMode.Tabs: Console.WriteLine("Launching tabs mode..."); AppManager.Current.CommunityService.GetCommunityStats(); //sync call AppManager.Current.CardsService.GetCards(); //sync call InvokeOnMainThread(()=>{ var tabBarController = new UITabBarController(); if (ScreenResolutionMatcher.IsiOS7()) { tabBarController.TabBar.BarTintColor = UIColor.Black; tabBarController.TabBar.TintColor = UIColor.White; } //tabBarController.Delegate = new ProdeTabBarDelegate(this); tabBarController.ViewControllers = new UIViewController [] { _communityViewController, _cardsViewController, _userViewController }; _RemoveAllSubviews(); window.RootViewController = tabBarController; }); break; case AppMode.Newbie: Console.WriteLine("Launching newbie mode..."); InvokeOnMainThread(()=>{ _tutorialViewController.View.Frame = ScreenResolutionMatcher.FullViewFrame(); _RemoveAllSubviews(); window.AddSubview(_tutorialViewController.View); }); break; } }
// This method is invoked when the application has loaded its UI and its ready to run public override bool FinishedLaunching (UIApplication app, NSDictionary options) { _tabController = new UITabBarController (); _sampleVC = new SampleViewController (); _sampleVC.TabBarItem.Title = "tab 1"; _secondVC = new SecondViewController (); _secondVC.TabBarItem.Title = "tab 2"; _tabController.ViewControllers = new UIViewController[] { _sampleVC, _secondVC }; window.AddSubview (_tabController.View); window.MakeKeyAndVisible (); return true; }
// // 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) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController [] { CreateViewController("Twitter"), CreateViewController("Dribbble"), CreateViewController("Apple"), CreateViewController("GitHub") }; window.RootViewController = tabBarController; // make the window visible window.MakeKeyAndVisible (); return true; }
// // 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) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); var viewController1 = new FirstViewController (); var viewController2 = new SecondViewController (); tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController [] { viewController1, viewController2, }; window.RootViewController = tabBarController; // make the window visible window.MakeKeyAndVisible (); return true; }
public override bool FinishedLaunching (UIApplication app, NSDictionary options) { // create a new window instance based on the screen size window = new UIWindow (UIScreen.MainScreen.Bounds); navCtrlr = new UINavigationController (); navCtrlr.NavigationBar.Translucent = false; blue = new BlueButtonViewController (); glossy = new GlossyButtonViewController (); lineart = new DrawingViewController (); news = new NewsDialogViewController (); // news.View.Frame = new System.Drawing.RectangleF (0 // , UIApplication.SharedApplication.StatusBarFrame.Height // , UIScreen.MainScreen.ApplicationFrame.Width // , UIScreen.MainScreen.ApplicationFrame.Height); navCtrlr.PushViewController (news, false); navCtrlr.TabBarItem = new UITabBarItem ("Calendar", UIImage.FromBundle ("Images/about.png"), 0); blue.TabBarItem = new UITabBarItem ("Blue Button", UIImage.FromBundle ("Images/about.png"), 0); glossy.TabBarItem = new UITabBarItem ("Glossy Button", UIImage.FromBundle ("Images/about.png"), 0); lineart.TabBarItem = new UITabBarItem ("Line Art", UIImage.FromBundle ("Images/about.png"), 0); tabBarController = new UITabBarController (); tabBarController.ViewControllers = new UIViewController [] { navCtrlr, blue, glossy, lineart }; window.AddSubview (tabBarController.View); // make the window visible window.MakeKeyAndVisible (); return true; }