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


C# UIApplication.SetStatusBarStyle方法代码示例

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


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

示例1: FinishedLaunching

		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) {
				app.SetStatusBarStyle (UIStatusBarStyle.LightContent, false);
				var frame = window.Frame;
				frame.Y = 20;
				window.Frame = frame;
			}

			PinchLayout pinchLayout = new PinchLayout ();
			pinchLayout.ItemSize = new CGSize (100.0f, 100.0f);

			window.RootViewController = (new ViewController (pinchLayout));
			window.MakeKeyAndVisible ();

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

示例2: FinishedLaunching

		//public static bool HideStatusBar {get {return false;}}

		//
		// 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)
		{
			// Applies theme styles globally
			GunmetalTheme.Apply ();

			//UIButton.Appearance.TintColor = UIColor.White;

			var idiom = UIDevice.CurrentDevice.UserInterfaceIdiom;

			if (idiom == UIUserInterfaceIdiom.Pad) 
				InitPad ();
			else 
				ConfigureiPhoneTabBar ();

			app.SetStatusBarStyle (UIStatusBarStyle.LightContent, true);
			UIApplication.SharedApplication.StatusBarHidden = HideStatusBar;
			
			// Override point for customization after application launch.
			return true;
		}
开发者ID:MbProg,项目名称:MasterDetailTestProject-IOS-64,代码行数:29,代码来源:AppDelegate.cs

示例3: FinishedLaunching

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

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

            ConfigureDatabase ();
            ConfigureAppearanceSettings ();
            ConfigureThirdPartyLibraries ();
            ConfigureiRate ();

            var verses = new UINavigationController (new VersesTableViewController ());
            var memorization = new UINavigationController (new MemorizationViewController ());

            var versesItem = new UITabBarItem { Image = UIImage.FromFile (Images.VersesTab) };
            var memorizationItem = new UITabBarItem { Image = UIImage.FromFile (Images.MemorizationTab) };

            verses.TabBarItem = versesItem;
            memorization.TabBarItem = memorizationItem;

            TabBarController.ViewControllers = new UIViewController[] {
                verses,
                memorization
            };
            TabBarController.TabBar.BackgroundImage = UIImage.FromFile (Images.TabBarBackground);

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

            UIApplication.SharedApplication.RegisterForRemoteNotificationTypes (UIRemoteNotificationType.Alert | UIRemoteNotificationType.Badge
                | UIRemoteNotificationType.Sound);
            app.SetStatusBarStyle (UIStatusBarStyle.LightContent, true);

            return true;
        }
开发者ID:pierceboggan,项目名称:Verses,代码行数:36,代码来源: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)
		{
			RectangleF rect = UIScreen.MainScreen.ApplicationFrame;

			window.BackgroundColor = UIColor.Black;

			//Create the OpenGL drawing view and add it to the window
			drawingView = new PaintingView (new RectangleF (rect.Location, rect.Size));
			window.AddSubview (drawingView);

			// Create a segmented control so that the user can choose the brush color.
			var images = new[] {
				UIImage.FromFile ("Images/Red.png"),
				UIImage.FromFile ("Images/Yellow.png"),
				UIImage.FromFile ("Images/Green.png"),
				UIImage.FromFile ("Images/Blue.png"),
				UIImage.FromFile ("Images/Purple.png")
			};
			if (UIDevice.CurrentDevice.CheckSystemVersion (7, 0)) {
				// we want the original colors, which is not the default iOS7 behaviour, so we need to
				// replace them with ones having the right UIImageRenderingMode
				for (int i = 0; i < images.Length; i++)
					images [i] = images [i].ImageWithRenderingMode (UIImageRenderingMode.AlwaysOriginal);
			}
			var segmentedControl = new UISegmentedControl (images);

			// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
			var frame = new RectangleF (rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
				rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);
			segmentedControl.Frame = frame;
			// When the user chooses a color, the method changeBrushColor: is called.
			segmentedControl.ValueChanged += ChangeBrushColor;
			// Make sure the color of the color complements the black background
			segmentedControl.TintColor = UIColor.DarkGray;
			// Set the third color (index values start at 0)
			segmentedControl.SelectedSegment = 2;

			// Add the control to the window
			window.AddSubview (segmentedControl);
			// Now that the control is added, you can release it
			// [segmentedControl release];

			float r, g, b;
			// Define a starting color
			HslToRgb (2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
			// Set the color using OpenGL
			GL.Color4 (r, g, b, PaintingView.BrushOpacity);

			
			// Look in the Info.plist file and you'll see the status bar is hidden
			// Set the style to black so it matches the background of the application
			app.SetStatusBarStyle (UIStatusBarStyle.Default, false);
			// Now show the status bar, but animate to the style.
			app.SetStatusBarHidden (false, true);

			//Configure and enable the accelerometer
			UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
			UIAccelerometer.SharedAccelerometer.Acceleration += OnAccelerated;
			
			//Show the window
			window.MakeKeyAndVisible ();
	
			return true;
		}
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:65,代码来源:Main.cs

示例5: FinishedLaunching

		public override void FinishedLaunching (UIApplication app)
		{
			RectangleF rect = UIScreen.MainScreen.ApplicationFrame;

			//Create a full-screen window
			window = new UIWindow (UIScreen.MainScreen.Bounds);
			window.BackgroundColor = UIColor.Black;

			//Create the OpenGL drawing view and add it to the window
			drawingView = new PaintingView (new RectangleF (rect.Location, rect.Size));
			window.AddSubview (drawingView);

			// Create a segmented control so that the user can choose the brush color.
			UISegmentedControl segmentedControl = new UISegmentedControl (new[]{
					UIImage.FromFile ("Red.png"),
					UIImage.FromFile ("Yellow.png"),
					UIImage.FromFile ("Green.png"),
					UIImage.FromFile ("Blue.png"),
					UIImage.FromFile ("Purple.png"),
			});

			// Compute a rectangle that is positioned correctly for the segmented control you'll use as a brush color palette
			RectangleF frame = new RectangleF (rect.X + LeftMarginPadding, rect.Height - PaletteHeight - TopMarginPadding,
				rect.Width - (LeftMarginPadding + RightMarginPadding), PaletteHeight);
			segmentedControl.Frame = frame;
			// When the user chooses a color, the method changeBrushColor: is called.
			segmentedControl.ValueChanged += ChangeBrushColor;
			segmentedControl.ControlStyle = UISegmentedControlStyle.Bar;
			// Make sure the color of the color complements the black background
			segmentedControl.TintColor = UIColor.DarkGray;
			// Set the third color (index values start at 0)
			segmentedControl.SelectedSegment = 2;

			// Add the control to the window
			window.AddSubview (segmentedControl);
			// Now that the control is added, you can release it
			// [segmentedControl release];

			float r, g, b;
			// Define a starting color
			HslToRgb (2.0f / PaletteSize, PaintingView.Saturation, PaintingView.Luminosity, out r, out g, out b);
			// Set the color using OpenGL
			GL.Color4 (r, g, b, PaintingView.BrushOpacity);

			//Show the window
			window.MakeKeyAndVisible ();
			// Look in the Info.plist file and you'll see the status bar is hidden
			// Set the style to black so it matches the background of the application
			app.SetStatusBarStyle (UIStatusBarStyle.BlackTranslucent, false);
			// Now show the status bar, but animate to the style.
			app.SetStatusBarHidden (false, true);

			//Configure and enable the accelerometer
			UIAccelerometer.SharedAccelerometer.UpdateInterval = 1.0f / AccelerometerFrequency;
			UIAccelerometer.SharedAccelerometer.Acceleration += OnAccelerated;
		}
开发者ID:CVertex,项目名称:monotouch-samples,代码行数:56,代码来源:GLPaint.cs


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