本文整理汇总了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);
}
示例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);
}
示例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);
}
}