本文整理汇总了C#中UIWebView.AddSubview方法的典型用法代码示例。如果您正苦于以下问题:C# UIWebView.AddSubview方法的具体用法?C# UIWebView.AddSubview怎么用?C# UIWebView.AddSubview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIWebView
的用法示例。
在下文中一共展示了UIWebView.AddSubview方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RowSelected
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
var webViewController = new UIViewController ();
var button = new UIBarButtonItem ("Back", UIBarButtonItemStyle.Plain, null);
var custom = new UIButton (new RectangleF (0, 0, 26, 15));
custom.SetBackgroundImage(UIImage.FromFile("./Assets/back.png"), UIControlState.Normal);
custom.TouchUpInside += (sender, e) => webViewController.NavigationController.PopViewControllerAnimated (true);
button.CustomView = custom;
webViewController.NavigationItem.LeftBarButtonItem = button;
var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
spinner.Center = new PointF (160, 160);
spinner.HidesWhenStopped = true;
var webView = new UIWebView (tableView.Bounds);
webView.Opaque = false;
webView.BackgroundColor = UIColor.Black;
webView.AddSubview (spinner);
spinner.StartAnimating ();
webView.LoadRequest (new NSUrlRequest (new NSUrl (string.Format(RequestConfig.Video, items[indexPath.Row].Id))));
webViewController.View = webView;
webViewController.Title = items[indexPath.Row].Category;
webView.LoadFinished += (object sender, EventArgs e) => {
spinner.StopAnimating();
};
((MainTabController)UIApplication.SharedApplication.Delegate.Window.RootViewController).
Video.InternalTopNavigation.PushViewController (webViewController,true);
tableView.DeselectRow (indexPath, true);
}
示例2: ViewDidLoad
public async override void ViewDidLoad ()
{
base.ViewDidLoad ();
if (!CrossConnectivity.Current.IsConnected)
{
await DialogUtil.ShowAlert ("Network Unavailable", "This application requires internet access to function. Please check your connection and try again.", "OK");
return;
}
if (AppCache.Instance.CanChangePassword)
this.Title = "PIN";
else
this.Title = "Password (PIN)";
#region Navigation
var Cancel = new UIBarButtonItem("Cancel"
, UIBarButtonItemStyle.Plain
, (sender, args) =>
{
this.NavigationController.PopViewController(true);
});
Cancel.TintColor = UIColor.Clear.FromHexString(RSColors.MM_BLUE);
Cancel.Enabled = true;
this.NavigationItem.SetLeftBarButtonItem(Cancel, true);
#endregion
this.View.BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4);
nfloat ScreenWidth = UIScreen.MainScreen.Bounds.Width;
nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;
ChangePinScrollview = new UIScrollView(new CGRect(0, 63, ScreenWidth, ScreenHeight + 700));
ChangePinView = new UIView(new CGRect(0, -63, ScreenWidth, ScreenHeight - 63));
ChangePinScrollview.ContentSize = new Size((int)ScreenWidth, (int)ScreenHeight + 700);
ChangePinScrollview.ScrollEnabled = true;
ChangePinScrollview.UserInteractionEnabled = true;
ChangePinScrollview.AddSubview(ChangePinView);
this.View.Add(ChangePinScrollview);
var EnterLabel = new UILabel(new CGRect(0, 28, 100, 18))
{
Font = UIFont.FromName("HelveticaNeue", 12f),
TextAlignment = UITextAlignment.Left,
Text = " ENTER",
TextColor = UIColor.Clear.FromHexString(RSColors.RS_DARK_GRAY)
};
//ChangePinView.AddSubview(EnterLabel);
var EnterView = new UIView(new CGRect(-1, 0, ScreenWidth + 2, 55))
{
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4),
};
EnterView.AddSubview(EnterLabel);
ChangePinView.Add(EnterView);
#region Validation Text
var MainPINView = new UIView(new CGRect(0, EnterView.Frame.Height + EnterView.Frame.Y, ScreenWidth, 153))
{
BackgroundColor = UIColor.White
};
// View.AddSubview(MainPINView);
ChangePinView.AddSubview(MainPINView);
MainPINView.Layer.BorderWidth = 1;
MainPINView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
var CurrentPinTextField = new UITextField(new CGRect(15, 0, ScreenWidth - 15, 50))
{
Font = UIFont.FromName("HelveticaNeue", 15f),
TintColor = UIColor.Black,
Placeholder = "Current PIN",
KeyboardType = UIKeyboardType.NumberPad,
SecureTextEntry = true
};
MainPINView.Add(CurrentPinTextField);
var PinView = new UIView(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y, ScreenWidth - 15, 1))
{
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
};
MainPINView.Add(PinView);
var NewPinTextField = new UITextField(new CGRect(15, CurrentPinTextField.Frame.Height + CurrentPinTextField.Frame.Y + 1, ScreenWidth - 15, 50))
{
Font = UIFont.FromName("HelveticaNeue", 15f),
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_WHITE),
Placeholder = "New PIN",
KeyboardType = UIKeyboardType.NumberPad,
SecureTextEntry = true
};
MainPINView.Add(NewPinTextField);
var PasswordView = new UIView(new CGRect(15, NewPinTextField.Frame.Height + NewPinTextField.Frame.Y, ScreenWidth - 15, 1))
{
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_6)
};
MainPINView.Add(PasswordView);
//.........这里部分代码省略.........
示例3: RowSelected
public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
{
// ignore the first row because an event handler is attached
// to the featured article view
if (indexPath.Row == 0) {
return;
}
// the non webview article version
//UIStoryboard board = UIStoryboard.FromName ("MainStoryboard", null);
//NewsDetailController article = (NewsDetailController)board.InstantiateViewController ("newsdetail");
//article.Data = items[indexPath.Row - 1];
// the webview article version
var webViewController = new UIViewController ();
var button = new UIBarButtonItem ("Back", UIBarButtonItemStyle.Plain, null);
var custom = new UIButton (new RectangleF (0, 0, 26, 15));
custom.SetBackgroundImage(UIImage.FromFile("./Assets/back.png"), UIControlState.Normal);
custom.TouchUpInside += (sender, e) => webViewController.NavigationController.PopViewControllerAnimated (true);
button.CustomView = custom;
webViewController.NavigationItem.LeftBarButtonItem = button;
var spinner = new UIActivityIndicatorView (UIActivityIndicatorViewStyle.WhiteLarge);
spinner.Center = new PointF (160, 160);
spinner.HidesWhenStopped = true;
var webView = new UIWebView (tableView.Bounds);
webView.Opaque = false;
webView.BackgroundColor = UIColor.Black;
webView.AddSubview (spinner);
spinner.StartAnimating ();
webView.LoadRequest (new NSUrlRequest (new NSUrl (string.Format(RequestConfig.Article, items[indexPath.Row - 1].SmallId))));
webViewController.View = webView;
webViewController.Title = items[indexPath.Row - 1].Category;
webView.LoadFinished += (object sender, EventArgs e) => {
spinner.StopAnimating();
};
((MainTabController)UIApplication.SharedApplication.Delegate.Window.RootViewController).
News.InternalTopNavigation.PushViewController (webViewController,true);
tableView.DeselectRow (indexPath, true);
}
示例4: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
this.Title = "More";
var navBar = NavigationController.NavigationBar;
navBar.BarTintColor = UIColor.White;
nfloat ScreenWidth = UIScreen.MainScreen.Bounds.Width;
nfloat ScreenHeight = UIScreen.MainScreen.Bounds.Height;
navBar.ShadowImage = new UIImage();
var ContactView = new UIView(new CGRect(0, 0, ScreenWidth, 300))
{
BackgroundColor = UIColor.White
};
var ContactUsView = new UIViewWithBorders(new CGRect(0, 0, ScreenWidth, 55))
{
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4)
};
ContactUsView.BorderWidth = new UIEdgeInsets(1, 1, 1, 1);
ContactUsView.BorderColorBottom = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5);
var ContactUsLabel = new UILabel(new CGRect(16, 15, ScreenWidth - 32, 39))
{
Font = UIFont.FromName("HelveticaNeue", 12f),
TextAlignment = UITextAlignment.Left,
Text = "CONTACT US",
TextColor = UIColor.Clear.FromHexString (RSColors.RS_DARK_GRAY),
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4)
};
ContactUsView.Add(ContactUsLabel);
ContactView.AddSubview(ContactUsView);
//WebView
var settingWebView = new UIWebView(new CGRect(0, ContactUsView.Frame.Height + ContactUsView.Frame.Y + 10, ContactUsView.Frame.Width, ContactView.Frame.Height - 120));
loadingOverlay = new LoadingOverlay(settingWebView.Bounds);
settingWebView.ScrollView.ScrollEnabled = false;
settingWebView.AddSubview(loadingOverlay);
ContactView.AddSubview(settingWebView);
settingWebView.LoadRequest(new NSUrlRequest(new NSUrl(UrlConsts.URL_MORE_CONTACT_INFO)));
settingWebView.LoadFinished += (sender, e) =>
{
if (loadingOverlay != null)
{
loadingOverlay.Hide();
loadingOverlay = null;
}
};
settingWebView.BackgroundColor = UIColor.White;
var MoreView = new UIView(new CGRect(-1, settingWebView.Frame.Height + settingWebView.Frame.Y + 1, ScreenWidth + 2, 55))
{
BackgroundColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_4),
};
var MoreLabel = new UILabel(new CGRect(8, 15, 60, 39))
{
Font = UIFont.FromName("HelveticaNeue", 12f),
TextAlignment = UITextAlignment.Left,
Text = " MORE",
TextColor = UIColor.Clear.FromHexString (RSColors.RS_DARK_GRAY)
};
MoreView.Layer.BorderWidth = 1;
MoreView.Layer.BorderColor = UIColor.Clear.FromHexString(RSColors.RS_LIGHT_GRAY_5).CGColor;
MoreView.AddSubview(MoreLabel);
ContactView.AddSubview(MoreView);
var SettingsTableData = new List<SettingsItem>();
var profileItem = new SettingsItem
{
EntryData = new TableData
{
Title = "Personal Information"
},
OnClickAction = "PushProfile"
};
SettingsTableData.Add(profileItem);
var changeLogInItem = new SettingsItem
{
EntryData = new TableData
{
Title = "Change Log In"
},
OnClickAction = "PushChangeLogIn"
};
SettingsTableData.Add(changeLogInItem);
var retireLinkItem = new SettingsItem
{
EntryData = new TableData
{
Title = "Go to www.TextShield.com"
},
OnClickAction = "LaunchTextShieldWeb"
};
//.........这里部分代码省略.........