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


C# UIToolbar.SetBackgroundImage方法代码示例

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


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

示例1: WebViewController

		protected WebViewController()
		{
			var fixedSpace = new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace, null) {
				Width = 26
			};
			var flexibleSpace = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace, null);

			toolbar = new UIToolbar ();
			toolbar.BarStyle = UIBarStyle.Black;
			
			topBar = new UIToolbar ();
			topBar.BarStyle = UIBarStyle.Black;			
			topBar.SetBackgroundImage(UIImage.FromBundle ("Images/opaqueBar.png"), UIToolbarPosition.Top, UIBarMetrics.Default);
			
			title = new UILabel(new RectangleF(10, 0, 80, 30))
			{
				BackgroundColor = UIColor.Clear,
				AdjustsFontSizeToFitWidth = true,
				Font = UIFont.BoldSystemFontOfSize(22),
				MinimumFontSize = 14,
				TextColor = UIColor.White,
				ShadowColor = UIColor.FromRGB(64, 74, 87),
				ShadowOffset = new SizeF (0, -1)
			};
			
			topBar.Items = new UIBarButtonItem []
			{
				new UIBarButtonItem (title),
				flexibleSpace,
				new UIBarButtonItem ("Close", UIBarButtonItemStyle.Bordered, (o, e) =>
				{ 
					Main.DismissModalViewControllerAnimated (true);
				})
			};
			
			backButton = new UIBarButtonItem (UIImage.FromBundle("Images/39-back.png"), UIBarButtonItemStyle.Plain, (o, e) => { WebView.GoBack (); });
			forwardButton = new UIBarButtonItem (UIImage.FromBundle("Images/40-forward.png"), UIBarButtonItemStyle.Plain, (o, e) => { WebView.GoForward (); });
			refreshButton = new UIBarButtonItem (UIBarButtonSystemItem.Refresh, (o, e) => { WebView.Reload (); });
			stopButton = new UIBarButtonItem (UIBarButtonSystemItem.Stop, (o, e) => { WebView.StopLoading (); });
			
			toolbar.Items = new UIBarButtonItem [] { backButton, fixedSpace, forwardButton, flexibleSpace, stopButton, fixedSpace, refreshButton };

			View.AddSubview (topBar);
			View.AddSubview (toolbar);
		}
开发者ID:modulexcite,项目名称:artapp,代码行数:45,代码来源:WebViewController.cs

示例2: Apply

 /// <summary>
 /// Apply this theme to all views with the given appearance.
 /// </summary>
 /// <param name="options">
 /// "blue", or null
 /// </para>
 public static void Apply(UIToolbar.UIToolbarAppearance appearance, string options = null)
 {
     if (options == "blue")
         appearance.SetBackgroundImage (blueNavigationBarBackground.Value, UIToolbarPosition.Any, UIBarMetrics.Default);
     else
         appearance.SetBackgroundImage (navigationBarBackground.Value, UIToolbarPosition.Any, UIBarMetrics.Default);
 }
开发者ID:tranuydu,项目名称:prebuilt-apps,代码行数:13,代码来源:Theme.cs

示例3: Apply

		/// <summary>
		/// Apply this theme to a specific view.
		/// </summary>
		/// <param name="options">
		/// "blue", or null
		/// </para>
		public static void Apply (UIToolbar view, string options = null)
		{
			if (options == "blue") {
				view.SetBackgroundImage (blueNavigationBarBackground.Value, UIToolbarPosition.Any, UIBarMetrics.Default);
			} else {
				view.SetBackgroundImage (navigationBarBackground.Value, UIToolbarPosition.Any, UIBarMetrics.Default);
			}
		}
开发者ID:harouny,项目名称:prebuilt-apps,代码行数:14,代码来源:Theme.cs


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