• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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
            MainWindow = new UIWindow(UIScreen.MainScreen.Bounds);

            var currentHomeUiViewController = new SplashViewController();
            RootNavigationController = new UINavigationController(currentHomeUiViewController);
            MainWindow.RootViewController = RootNavigationController;

            var titleTextAttributes = new UITextAttributes();
            titleTextAttributes.TextColor = UIColor.FromRGB(25, 83, 135);
            titleTextAttributes.TextShadowColor = UIColor.Clear;
            titleTextAttributes.Font = UIFont.SystemFontOfSize(16);

            //			if (IsIOS5OrGreater)
            //			{
            //				UINavigationBar.Appearance.SetTitleTextAttributes(titleTextAttributes);
            //				UINavigationBar.Appearance.SetBackgroundImage(UIImage.FromBundle("/Images/top_bar_bg"), UIBarMetrics.Default);
            //			}
            //

            MainWindow.MakeKeyAndVisible();

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


示例2: OnSetupWindow

 protected virtual void OnSetupWindow()
 {
     UIWindow window = new UIWindow(UIScreen.MainScreen.Bounds);
     window.RootViewController = NavigationController;
     window.MakeKeyAndVisible();
     var result = _navigationProvider.NavigateAsync(MainPageViewModelType);
 }
开发者ID:ryanhorath,项目名称:Rybird.Framework,代码行数:7,代码来源:iOSApp.cs


示例3: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			Forms.Init ();


			// http://forums.xamarin.com/discussion/21148/calabash-and-xamarin-forms-what-am-i-missing
			Forms.ViewInitialized += (object sender, ViewInitializedEventArgs e) => {

				// http://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/
				if (null != e.View.StyleId) {
					e.NativeView.AccessibilityIdentifier = e.View.StyleId;
					Console.WriteLine("Set AccessibilityIdentifier: " + e.View.StyleId);
				}
			};


			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			window.RootViewController = App.GetMainPage ().CreateViewController ();
			window.MakeKeyAndVisible ();


			#if DEBUG
			// requires Xamarin Test Cloud Agent component
			Xamarin.Calabash.Start();
			#endif


			return true;
		}
开发者ID:ZaK14120,项目名称:xamarin-forms-samples,代码行数:30,代码来源:AppDelegate.cs


示例4: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			// create our window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			
			// are we running an iPhone or an iPad?
			DetermineCurrentDevice ();

			// instantiate our main navigatin controller and add it's view to the window
			mainNavController = new UINavigationController ();
			
			switch (CurrentDevice)
			{
				case DeviceType.iPhone:
					iPhoneHome = new HandlingRotation.Screens.iPhone.Home.HomeScreen ();
					mainNavController.PushViewController (iPhoneHome, false);
					break;
				
				case DeviceType.iPad:
					iPadHome = new HandlingRotation.Screens.iPad.Home.HomeScreenPad ();
					mainNavController.PushViewController (iPadHome, false);
					break;
			}

			window.RootViewController = mainNavController;

			return true;
		}
开发者ID:7sharp9,项目名称:monotouch-samples,代码行数:29,代码来源:AppDelegate.cs


示例5: 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)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackTranslucent;
            viewController = new FlyOutNavigationController ();
            viewController.NavigationRoot = new RootElement ("")
            {
                new Section ("Section 1"){
                    new StringElement ("View 1"),
                    new ImageStringElement("View 2",UIImage.FromFile("jhill.jpeg")),
                    new StringElement ("View 3"),
                },
                new Section ("Section 2"){
                    new StringElement ("View 1"),
                    new StringElement ("View 2"),
                }
            };
            viewController.ViewControllers = new UIViewController[]{
                 new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 1")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 2")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 1"){new Section (){new StringElement ("View 3")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 1")}}))
                ,new UINavigationController (new BaseDialogViewController (viewController, new RootElement ("Section 2"){new Section (){new StringElement ("View 2")}}))
            };
            window.RootViewController = viewController;
            window.MakeKeyAndVisible ();

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


示例6: 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)
        {
            //
            // ENTER YOUR LICENSE INFO HERE
            //
            PXEngine.LicenseKeyForUser("SERIAL NUMBER", "USER NAME");

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

            window.RootViewController = new MyViewController();

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

            PXEngine shared = PXEngine.SharedInstance();

            // Print the version an build date
            Console.WriteLine("Pixate Engine v{0} {1}", shared.Version, shared.BuildDate);

            // Print the location of the current application-level stylesheet
            Console.WriteLine("CSS File location: {0}", PXStylesheet.CurrentApplicationStylesheet().FilePath);

            // Monitor for changes in the stylesheet and update styles live
            PXStylesheet.CurrentApplicationStylesheet().MonitorChanges = true;

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


示例7: 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)
        {
            window = new UIWindow (UIScreen.MainScreen.Bounds);

            viewController = new UINavigationController ();
            viewController.PushViewController(new MainScreenGroup(), true);
            viewController.NavigationBar.Opaque = true;

            window.MakeKeyAndVisible ();

            #if LITE
            AdManager.LoadBanner();
            #endif

            // On iOS5 we use the new window.RootViewController, on older versions, we add the subview
            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = viewController;
            else
                window.AddSubview (viewController.View);

            #if LITE
            Apprater = new Appirater(527002436);
            #else
            Apprater = new Appirater(526844540);
            #endif
            Apprater.AppLaunched();
            return true;
        }
开发者ID:zekiller3,项目名称:SMSParty,代码行数:35,代码来源: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)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			var root = new RootElement("MBProgressHUD")
			{
				new Section ("Samples")
				{
					new StringElement ("Simple indeterminate progress", ShowSimple),
					new StringElement ("With label", ShowWithLabel),
					new StringElement ("With details label", ShowWithDetailsLabel),
					new StringElement ("Determinate mode", ShowWithLabelDeterminate),
					new StringElement ("Annular determinate mode", ShowWIthLabelAnnularDeterminate),
					new StringElement ("Custom view", ShowWithCustomView),
					new StringElement ("Mode switching", ShowWithLabelMixed),
					new StringElement ("Using handlers", ShowUsingHandlers),
					new StringElement ("On Window", ShowOnWindow),
					new StringElement ("NSURLConnection", ShowUrl),
					new StringElement ("Dim background", ShowWithGradient),
					new StringElement ("Text only", ShowTextOnly),
					new StringElement ("Colored", ShowWithColor),
				}
			};

			dvcDialog = new DialogViewController(UITableViewStyle.Grouped, root, false);
			navController = new UINavigationController(dvcDialog);

			window.RootViewController = navController;
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:JonathanTLH,项目名称:PanTiltZoomSystem,代码行数:39,代码来源:AppDelegate.cs


示例9: InitPanoramaSample

        private void InitPanoramaSample()
        {
            this.window = new UIWindow(UIScreen.MainScreen.Bounds);

            this.window.RootViewController = new TestPanorama();
            this.window.MakeKeyAndVisible();
        }
开发者ID:utahking,项目名称:MonoKit,代码行数:7,代码来源:AppDelegate.cs


示例10: MXTouchContainer

        private MXTouchContainer(MXApplication theApp, UIApplicationDelegate appDelegate, UIWindow window)
            : base(theApp, appDelegate, window)
        {
            touchNavigation = new MXTouchNavigation(appDelegate, window);

            ViewGroups = new List<MXTouchViewGroup>();
        }
开发者ID:technohead,项目名称:MonoCross,代码行数:7,代码来源:MXTouchContainer.cs


示例11: 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


示例12: 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


示例13: FinishedLaunching

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        UIApplication.SharedApplication.StatusBarHidden = true;

        image = new UIImageView (UIScreen.MainScreen.Bounds) {
            Image = UIImage.FromFile ("Background.png")
        };
        text = new UITextField (new RectangleF (44, 32, 232, 31)) {
            BorderStyle = UITextBorderStyle.RoundedRect,
            TextColor = UIColor.Black,
            BackgroundColor = UIColor.Black,
            ClearButtonMode = UITextFieldViewMode.WhileEditing,
            Placeholder = "Hello world",
        };
        text.ShouldReturn = delegate (UITextField theTextfield) {
            text.ResignFirstResponder ();

            label.Text = text.Text;
            return true;
        };

        label = new UILabel (new RectangleF (20, 120, 280, 44)){
            TextColor = UIColor.Gray,
            BackgroundColor = UIColor.Black,
            Text = text.Placeholder
        };

        var vc = new ViewController (this) { image, text, label };

        window = new UIWindow (UIScreen.MainScreen.Bounds){ vc.View };

        window.MakeKeyAndVisible ();

        return true;
    }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:35,代码来源:hello.cs


示例14: FinishedLaunching

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

			// tests can be inside the main assembly
			runner.Add (Assembly.GetExecutingAssembly ());
#if false
			// you can use the default or set your own custom writer (e.g. save to web site and tweet it ;-)
			runner.Writer = new TcpTextWriter ("10.0.1.2", 16384);
			// start running the test suites as soon as the application is loaded
			runner.AutoStart = true;
			// crash the application (to ensure it's ended) and return to springboard
			runner.TerminateAfterExecution = true;
#endif
#if false
			// you can get NUnit[2-3]-style XML reports to the console or server like this
			// replace `null` (default to Console.Out) to a TcpTextWriter to send data to a socket server
			// replace `NUnit2XmlOutputWriter` with `NUnit3XmlOutputWriter` for NUnit3 format
			runner.Writer = new NUnitOutputTextWriter (runner, null, new NUnitLite.Runner.NUnit2XmlOutputWriter ());
			// the same AutoStart and TerminateAfterExecution can be used for build automation
#endif
			window.RootViewController = new UINavigationController (runner.GetViewController ());
			window.MakeKeyAndVisible ();
			return true;
		}
开发者ID:couchbasedeps,项目名称:Touch.Unit,代码行数:26,代码来源:AppDelegate.cs


示例15: FinishedLaunching

 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     Window = new UIWindow (UIScreen.MainScreen.Bounds);
     Window.RootViewController = new ViewController ();
     Window.MakeKeyAndVisible ();
     return true;
 }
开发者ID:GSerjo,项目名称:monotouch-samples,代码行数:7,代码来源:AppDelegate.cs


示例16: 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


示例17: 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);

			var web = new WebElement ();
			web.HtmlFile = "instructions";

			var root = new RootElement ("Kannada Keyboard") {
				new Section{
					new UIViewElement("Instruction", web.View, false)
				}
			};
		
			var dv = new DialogViewController (root) {
				Autorotate = true
			};
			var navigation = new UINavigationController ();
			navigation.PushViewController (dv, true);				

			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.MakeKeyAndVisible ();
			window.AddSubview (navigation.View);
			
			return true;
		}
开发者ID:CBrauer,项目名称:monotouch-samples,代码行数:33,代码来源:AppDelegate.cs


示例18: 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


示例19: 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);

			var sqliteFilename = "TodoSQLite.db3";
			string documentsPath = Environment.GetFolderPath (Environment.SpecialFolder.Personal); // Documents folder
			string libraryPath = Path.Combine (documentsPath, "..", "Library"); // Library folder
			var path = Path.Combine(libraryPath, sqliteFilename);

			// This is where we copy in the prepopulated database
			Console.WriteLine (path);
			if (!File.Exists (path)) {
				File.Copy (sqliteFilename, path);
			}

			var plat = new SQLite.Net.Platform.XamarinIOS.SQLitePlatformIOS();
			var conn = new SQLite.Net.SQLiteConnection(plat, path);

			// Set the database connection string
			App.SetDatabaseConnection (conn);

//			window.RootViewController = new HybridRazorViewController ();
			window.RootViewController = new UINavigationController(new NativeListViewController ());

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

			return true;
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:31,代码来源:AppDelegate.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UInt128类代码示例发布时间:2022-05-24
下一篇:
C# UIWidget.Pivot类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap