当前位置: 首页>>代码示例>>C#>>正文


C# UIWindow.MakeKeyAndVisible方法代码示例

本文整理汇总了C#中UIWindow.MakeKeyAndVisible方法的典型用法代码示例。如果您正苦于以下问题:C# UIWindow.MakeKeyAndVisible方法的具体用法?C# UIWindow.MakeKeyAndVisible怎么用?C# UIWindow.MakeKeyAndVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIWindow的用法示例。


在下文中一共展示了UIWindow.MakeKeyAndVisible方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			this._navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				this._homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone ();
			} else {
//				this._viewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
			}


			// push the view controller onto the nav controller and show the window
			this._navController.PushViewController (this._homeViewController, false);
			window.RootViewController = this._navController;
			window.MakeKeyAndVisible ();

			// enable this to see logging
			//NativeCSS.SetDebugLogging(true);

			// To live edit, cd to styles.css and run "python -m SimpleHTTPServer"
			NativeCSS.StyleWithCSS("styles.css",
			                       new Uri("http://localhost:8000/styles.css"), 
			                       RemoteContentRefreshPeriod.EveryFiveSeconds);


			return true;
		}
开发者ID:305088020,项目名称:ChART,代码行数:35,代码来源:AppDelegate.cs

示例2: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Current = this;

			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();


			// Create the database file
			var sqliteFilename = "TodoItemDB.db3";
			// we need to put in /Library/ on iOS5.1 to meet Apple's iCloud terms
			// (they don't want non-user-generated data in Documents)
			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
			string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
			var path = Path.Combine(libraryPath, sqliteFilename);
			conn = new SQLiteConnection(path);
			TodoManager = new TodoItemManager(conn);


			// create our nav controller
			navController = new UINavigationController ();

			// create our Todo list screen
			homeViewController = new Screens.HomeScreen ();

			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:35,代码来源:AppDelegate.cs

示例3: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone();
			} else {
//				homeViewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
			}
			
			// Styling
			UINavigationBar.Appearance.TintColor = UIColor.FromRGB (38, 117 ,255); // nice blue
			UITextAttributes ta = new UITextAttributes();
			ta.Font = UIFont.FromName ("AmericanTypewriter-Bold", 0f);
			UINavigationBar.Appearance.SetTitleTextAttributes(ta);
			ta.Font = UIFont.FromName ("AmericanTypewriter", 0f);
			UIBarButtonItem.Appearance.SetTitleTextAttributes(ta, UIControlState.Normal);
			

			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:BeardAnnihilator,项目名称:xamarin-samples,代码行数:34,代码来源:AppDelegate.cs

示例4: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			this._navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				this._homeViewController = new Tasky.Screens.iPhone.Home.controller_iPhone();
			} else {
//				this._viewController = new Hello_UniversalViewController ("Hello_UniversalViewController_iPad", null);
			}
			
			// push the view controller onto the nav controller and show the window
			this._navController.PushViewController(this._homeViewController, false);
			window.RootViewController = this._navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:GSerjo,项目名称:Seminars,代码行数:25,代码来源:AppDelegate.cs

示例5: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			// make the window visible
			window.MakeKeyAndVisible ();
			// create our nav controller
			navController = new UINavigationController ();
			// create our Todo list screen
			homeViewController = new Screens.HomeScreen ();
			//			UIApplication.SharedApplication.KeyWindow.TintColor = UIColor.White;
			//			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x91, 0xCA, 0x47);
			// green theme
			//			navController.NavigationBar.TintColor = UIColor.White;
			//			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E);
			navController.NavigationBar.TintColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E);
			// 6FA22E dark-green
			navController.NavigationBar.BarTintColor = UIColor.FromRGB (0xCF, 0xEF, 0xA7);
			// CFEFA7 light-green
			UINavigationBar.Appearance.SetTitleTextAttributes (new UITextAttributes () {
				//				TextColor = UIColor.White,
				TextColor = UIColor.FromRGB (0x6F, 0xA2, 0x2E),
				// 6FA22E dark-green
				TextShadowColor = UIColor.Clear
			});
			// push the view controller onto the nav controller and show the window
			navController.PushViewController (homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:tbrown0139,项目名称:What-a-task,代码行数:31,代码来源:AppDelegate.cs

示例6: FinishedLaunching

        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Current = this;

            // create a new window instance based on the screen size
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            // make the window visible
            window.MakeKeyAndVisible ();

            TodoContractMngr = new TodoContractManager("http://40.118.255.235:8000",
                "http://40.118.255.235/eth/v1.2");

            // create our nav controller
            navController = new UINavigationController ();

            // create our Todo list screen
            homeViewController = new Screens.HomeScreen ();

            // push the view controller onto the nav controller and show the window
            navController.PushViewController(homeViewController, false);
            window.RootViewController = navController;
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:charlescrain,项目名称:xamarin-sample-app,代码行数:26,代码来源:AppDelegate.cs

示例7: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create a new window instance based on the screen size
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// make the window visible
			window.MakeKeyAndVisible ();
			
			// create our nav controller
			navController = new UINavigationController ();

			// create our home controller based on the device
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				homeViewController = new Screens.HomeScreen();
			} else {
// sample does not contain an iPad UI
//				homeViewController = new Screens.iPadHomeScreen ();
			}
			
			// push the view controller onto the nav controller and show the window
			navController.PushViewController(homeViewController, false);
			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:BeardAnnihilator,项目名称:xamarin-samples,代码行数:26,代码来源:AppDelegate.cs

示例8: FinishedLaunching

        //
        // 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);

            viewMitarbeiterselektion = new ViewMitarbeiterselektion ();
            window.RootViewController = viewMitarbeiterselektion;
            window.MakeKeyAndVisible ();

            // make the window visible
            window.MakeKeyAndVisible ();

            return true;
        }
开发者ID:4ndysnipez,项目名称:DatePickerTest,代码行数:21,代码来源:AppDelegate.cs

示例9: FinishedLaunching

		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			window = new UIWindow(UIScreen.MainScreen.Bounds);

			var controller = new UIViewController();
			var view = new UIView (UIScreen.MainScreen.Bounds);
			view.BackgroundColor = UIColor.White;
			controller.View = view;

			controller.NavigationItem.Title = "SignalR Client";

			var textView = new UITextView(new CGRect(0, 0, 320, view.Frame.Height - 0));
			view.AddSubview (textView);


			navController = new UINavigationController (controller);

			window.RootViewController = navController;
			window.MakeKeyAndVisible();

			if (SIGNALR_DEMO_SERVER == "http://YOUR-SERVER-INSTANCE-HERE") {
				textView.Text = "You need to configure the app to point to your own SignalR Demo service.  Please see the Getting Started Guide for more information!";
				return true;
			}
			
			var traceWriter = new TextViewWriter(SynchronizationContext.Current, textView);

			var client = new CommonClient(traceWriter);
			client.RunAsync(SIGNALR_DEMO_SERVER);

			return true;
		}
开发者ID:Coladela,项目名称:signalr-chat,代码行数:32,代码来源:AppDelegate.cs

示例10: FinishedLaunching

        //
        // 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)
        {
			Current = this;

			var log = new LoggerConfiguration().CreateLogger();

			log.Information("Loading");

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;

            // create a new window instance based on the screen size
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a view, add it here:
            // window.RootViewController  = navigationController;

			var rootNavigationController = Utilities.BuildNavigationController();
            rootNavigationController.PushViewController(new ViewControllers.Login(), false);
            window.RootViewController = rootNavigationController;

            // make the window visible
            window.MakeKeyAndVisible();

            Utilities.SetTintColor();

            autoSuspendHelper.FinishedLaunching(app, options);

            return true;
        }
开发者ID:ehill8624,项目名称:ValkreRender,代码行数:36,代码来源:AppDelegate.cs

示例11: FinishedLaunching

		//
		// 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);
			
			// load the appropriate UI, depending on whether the app is running on an iPhone or iPad
			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone) {
				var controller = new RootViewController ();
				navigationController = new UINavigationController (controller);
				window.RootViewController = navigationController;
			} else {
				var masterViewController = new RootViewController ();
				var masterNavigationController = new UINavigationController (masterViewController);
				var detailViewController = new DetailViewController ();
				var detailNavigationController = new UINavigationController (detailViewController);
				
				splitViewController = new UISplitViewController ();
				splitViewController.WeakDelegate = detailViewController;
				splitViewController.ViewControllers = new UIViewController[] {
					masterNavigationController,
					detailNavigationController
				};
				
				window.RootViewController = splitViewController;
			}

			// make the window visible
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:XamarinControls,项目名称:govindaraokondala-horizontal-scrolling-in-Table-in-IOS,代码行数:38,代码来源:AppDelegate.cs

示例12: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// check is it 64bit or 32bit
			Console.WriteLine (IntPtr.Size);

			// Main app do nothing
			// Go to Photo > Edit then choose PhotoFilter to start app extension

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.BackgroundColor = UIColor.White;

			note = new UILabel ();
			note.Text = "Note that the app in this sample only serves as a host for the extension. To use the sample extension, edit a photo or video using the Photos app, and tap the extension icon";
			note.Lines = 0;
			note.LineBreakMode = UILineBreakMode.WordWrap;
			var frame = note.Frame;
			note.Frame = new CGRect (0, 0, UIScreen.MainScreen.Bounds.Width * 0.75f, 0);
			note.SizeToFit ();

			window.AddSubview (note);
			note.Center = window.Center;

			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:g7steve,项目名称:monotouch-samples,代码行数:25,代码来源:AppDelegate.cs

示例13: FinishedLaunching

		//
		// 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 theme
            SetTheme();

			_window = new UIWindow (UIScreen.MainScreen.Bounds);

            //Process the accounts
            ProcessAccounts();
            
            //Make what ever window visible.
            _window.MakeKeyAndVisible();

			_window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:envy4s,项目名称:Gistacular,代码行数:23,代码来源:Main.cs

示例14: FinishedLaunching

		public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
		{
			// Override point for customization after application launch.
			// If not required for your application you can safely delete this method

			// Code to start the Xamarin Test Cloud Agent
			#if ENABLE_TEST_CLOUD
			Xamarin.Calabash.Start();
			#endif

			Window = new UIWindow (UIScreen.MainScreen.Bounds);

			application.StatusBarHidden = true;
			application.ApplicationSupportsShakeToEdit = true;

			var path = NSBundle.MainBundle.PathForResource("appdata", "json");
			var json = File.ReadAllText (path);
			var data = Newtonsoft.Json.JsonConvert.DeserializeObject<AppData>(json);

			Window.BackgroundColor = UIColor.White;
			_tabViewController = new FlashCardSetTabViewController (data);
			Window.RootViewController = _tabViewController;

			Window.MakeKeyAndVisible ();

			return true;
		}
开发者ID:funhead,项目名称:baby-flashcard-app,代码行数:27,代码来源:AppDelegate.cs

示例15: LoginPageRenderer

        public LoginPageRenderer()
        {
            dialog = new DialogViewController(new RootElement("Login"));

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            window.RootViewController = new UINavigationController(dialog);
            window.MakeKeyAndVisible();

            if (App.IsGoogleLogin && !App.IsLoggedIn)
            {
                var myAuth = new GoogleAuthenticator("730990345527-h7r23gcdmdllgke4iud4di76b0bmpnbb.apps.googleusercontent.com",
                    "https://www.googleapis.com/auth/userinfo.email",
                    "https://accounts.google.com/o/oauth2/auth",
                    "https://www.googleapis.com/plus/v1/people/me");
				UIViewController vc = myAuth.authenticator.GetUI();

                myAuth.authenticator.Completed += async (object sender, AuthenticatorCompletedEventArgs eve) =>
                {
                    //dialog.DismissViewController(true, null);
                    window.Hidden = true;
                    dialog.Dispose();
                    window.Dispose();
                    if (eve.IsAuthenticated)
                    {
                        var user = await myAuth.GetProfileInfoFromGoogle(eve.Account.Properties["access_token"].ToString());
						await App.SaveUserData(user,true);
						//dialog.DismissViewController(true, null);
						App.IsLoggedIn = true;
						App.SuccessfulLoginAction.Invoke();
                    }
                };

                dialog.PresentViewController(vc, true, null);
            }
        }
开发者ID:praveenmohanmm,项目名称:PurposeColor_Bkp_Code,代码行数:35,代码来源:LoginPageRenderer.cs


注:本文中的UIWindow.MakeKeyAndVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。