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


C# UIWindow.AddSubview方法代码示例

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


在下文中一共展示了UIWindow.AddSubview方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			
			// If you have defined a view, add it here:
			// window.AddSubview (navigationController.View);

			window.Bounds = UIScreen.MainScreen.Bounds;
			window.BackgroundColor = UIColor.White;

			if (null == main_view_controller) 
			{
				main_view_controller =  new MainViewCotroller();

				//
				main_view_controller.View.BackgroundColor = new UIColor(30f,30f,30f, 20f);
			}
			window.AddSubview(main_view_controller.View);


			UILabel purpleLabel = new UILabel();
			purpleLabel.BackgroundColor = UIColor.Purple;
			purpleLabel.Text = "Hello none IB World";
			purpleLabel.Frame = window.Frame;
			window.AddSubview(purpleLabel);

			// make the window visible
			window.MakeKeyAndVisible ();
			
			return true;
		}
开发者ID:moljac,项目名称:MonoTouch.Samples,代码行数:39,代码来源:AppDelegate.cs

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

            InvokeOnMainThread(delegate {
                TwitterAccount.getAccount();
            });

            flyoutController = new FlyOutNavigationController();
            tl = new Timeline(flyoutController);
            flyoutController.NavigationRoot = new RootElement("")
            {
                new Section("Navigation")
                {
                    new StringElement("Timeline")
                }
            };

            flyoutController.ViewControllers = new UIViewController[]
            {
                new UINavigationController(tl)
            };

            window.AddSubview(flyoutController.View);

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

            return true;
        }
开发者ID:timrisi,项目名称:Hashed,代码行数:38,代码来源:AppDelegate.cs

示例3: FinishedLaunching

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

            // Create some sample data
            contents.Add (new Rss { Title = "TUAW", Detail = "The Unofficial Apple Weblog", Badge = "17" });
            contents.Add (new Rss { Title = "High Caffine Content", Detail = "Steven Troughton Smith", Badge = "2" });
            contents.Add (new Rss { Title = "Smoking Apples", Detail = "Blog about Apple Software...", Badge = "145" });
            contents.Add (new Rss { Title = "Daring Fireball", Detail = "The musings of John Gruber", Badge = "0" });
            contents.Add (new Rss { Title = "tmdvs.me", Detail = "Long detail text to test update by tonymillion on github", Badge = "2345" });

            // Build a tableview
            tableViewController = new UITableViewController ();
            tableViewController.TableView.Frame = new RectangleF (0, 20, this.window.Frame.Width, this.window.Frame.Height - 20);
            tableViewController.TableView.Source = new TableViewSource (contents);
            tableViewController.Title = "Tim's RSS Reader";
            tableViewController.NavigationItem.RightBarButtonItem = tableViewController.EditButtonItem;

            // Add to the navigation controller
            navigationController = new UINavigationController (tableViewController);

            // Add to the window, and show
            window.AddSubview (navigationController.View);
            window.MakeKeyAndVisible ();
            return true;
        }
开发者ID:conceptdev,项目名称:TDBadgedCellSharp,代码行数:26,代码来源:AppDelegate.cs

示例4: FinishedLaunching

        // 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;
        }
开发者ID:fluffyclaret,项目名称:MapStuff,代码行数:28,代码来源: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)
		{
			// 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

示例6: FinishedLaunching

		// This method is invoked when the application has loaded its UI and its ready to run
		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			_Navigation = new UINavigationController();

            _Window = new UIWindow(UIScreen.MainScreen.Bounds);
			
			if (_DefaultImage != null)
				_Window.BackgroundColor = UIColor.FromPatternImage(_DefaultImage);
		
			_Navigation.View.Alpha = 0.0f;

			_Window.AddSubview(_Navigation.View);
			_Window.MakeKeyAndVisible();
			
			MonoMobileApplication.Window = _Window;
			MonoMobileApplication.NavigationController = _Navigation;
			
			MonoMobileApplication.Views = new List<UIView>();
			foreach(var viewType in MonoMobileApplication.ViewTypes)
			{
				MonoMobileApplication.Views.Add(Activator.CreateInstance(viewType) as UIView);
			}

			// this method initializes the main NavigationController
			var startupThread = new Thread(Startup);
			startupThread.Start();
			
			return true;
		}
开发者ID:follesoe,项目名称:MonoMobile.MVVM,代码行数:30,代码来源:MonoMobileAppDelegate.cs

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

示例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);
            UIApplication.SharedApplication.SetStatusBarHidden(true, true);

            var scrollView = new UIScrollView(window.Bounds);
            window.AddSubview(scrollView);

            var view = new HypnosisView() { Frame = window.Bounds };

            scrollView.AddSubview(view);
            scrollView.ContentSize = window.Bounds.Size;

            scrollView.MinimumZoomScale = 1.0f;
            scrollView.MaximumZoomScale = 5.0f;
            scrollView.Delegate = new HSAnonScrollViewerDelegate(sv => {
                return view;
            });

            window.BackgroundColor = UIColor.White;

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

            return true;
        }
开发者ID:paulcbetts,项目名称:BigNerdIOS-MonoDevelop,代码行数:34,代码来源:AppDelegate.cs

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

示例10: FinishedLaunching

		// This method is invoked when the application has loaded its UI and its ready to run
		public override bool FinishedLaunching(UIApplication app, NSDictionary options)
		{
			MonoMobileApplication.NavigationController = new UINavigationController();
			
			_Window = new UIWindow(UIScreen.MainScreen.Bounds);

			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
				_DefaultImage = UIImage.FromBundle("DefaultiPad.png");
			else
				_DefaultImage = UIImage.FromBundle("Default.png");
			
			if (_DefaultImage != null)
			{
				var imageView = new UIImageView(_Window.Bounds);
				imageView.Image = _DefaultImage;
				_Window.Add(imageView);
				_Window.BackgroundColor = UIColor.Clear;
			}

			MonoMobileApplication.NavigationController.View.Alpha = 0.0f;

			_Window.AddSubview(MonoMobileApplication.NavigationController.View);
			_Window.MakeKeyAndVisible();
			
			MonoMobileApplication.Window = _Window;
			
			BeginInvokeOnMainThread(()=> { Startup(); });
			
			return true;
		}
开发者ID:vknair74,项目名称:MonoMobile.Views,代码行数:31,代码来源:MonoMobileAppDelegate.cs

示例11: FinishedLaunching

        // This method is invoked when the application has loaded its UI and its ready to run
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            Console.WriteLine ("AppDelegate.FinishedLaunching");
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            var nc = new UINavigationController ();
            navigation_controller = nc;
            var lvc = new LoginSettingsViewController () { AppDelegate = this };
            nc.PushViewController (lvc, false);

            room_list_controller = new UITableViewController ();
            room_controller = new UITableViewController ();

            nc.TopViewController.Title = "MonoTouchLingr";
            window.AddSubview (nc.View);
            window.MakeKeyAndVisible ();

            if (File.Exists (cfgfile)) {
                string [] lines = File.ReadAllLines (cfgfile);
                //Login (lines [0], lines [1]);
                lvc.ViewLoaded += delegate {
                    lvc.UserName = lines [0];
                    lvc.Password = lines [1];
                };
            }
            return true;
        }
开发者ID:atsushieno,项目名称:slingr,代码行数:27,代码来源:Main.cs

示例12: FinishedLaunching

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

            root = new RootElement ("Dropbox Chooser Demo") {
                new Section{
                    new StringElement("Preview", delegate {
                        ChooseFile(DBChooserLinkType.Preview);
                }),
                    new StringElement("Direct Dowload", delegate {
                        ChooseFile(DBChooserLinkType.Direct);
                })
                },

                //This section is used to show results metadata
                new Section("Metadata"),

                //This section used to show link and thumbnails
                new Section("Links and Thumbnails")

            };

            var dv = new DialogViewController (root);
            navigation = new UINavigationController ();
            navigation.PushViewController (dv, true);

            if (UIDevice.CurrentDevice.CheckSystemVersion (5, 0))
                window.RootViewController = navigation;
            else
                window.AddSubview (navigation.View);

            window.MakeKeyAndVisible ();

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

示例13: FinishedLaunching

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

示例14: CreateMainWindow

        private UIWindow CreateMainWindow()
        {
            var window = new UIWindow(UIScreen.MainScreen.Bounds);

            _tabController = new TabControllerContainer();
            window.AddSubview(_tabController.View);

            return window;
        }
开发者ID:pixelmeister,项目名称:MonoTouchRXDemo,代码行数:9,代码来源:Main.cs

示例15: SetupWindow

    void SetupWindow()
    {
        window = new UIWindow (UIScreen.MainScreen.Bounds);
        UILabel l = new UILabel (new RectangleF (50, 50, 230, 100)) {
            Text = "Hello from MonoTouch"
        };

        window.AddSubview (l);
        window.MakeKeyAndVisible ();
    }
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:10,代码来源:metronome.cs


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