本文整理汇总了C#中UIWebView.RemoveFromSuperview方法的典型用法代码示例。如果您正苦于以下问题:C# UIWebView.RemoveFromSuperview方法的具体用法?C# UIWebView.RemoveFromSuperview怎么用?C# UIWebView.RemoveFromSuperview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIWebView
的用法示例。
在下文中一共展示了UIWebView.RemoveFromSuperview方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ViewDidLoad
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
var consentWebView = new UIWebView(View.Bounds);
View.AddSubview(consentWebView);
var url = _client.CreateConsentUri(Provider.Custom);
consentWebView.LoadRequest(new NSUrlRequest(new NSUrl(url)));
consentWebView.ShouldStartLoad += (webView, request, navigationType) =>
{
if (request.Url.AbsoluteString.StartsWith(FranceConnectClient.BaseConsentRedirectUri, StringComparison.OrdinalIgnoreCase))
{
var task = Task.Factory.StartNew(async () =>
{
await _client.AuthenticateAsync(request.Url.AbsoluteString, Provider.Custom.GetRedirectUri());
var resource = await _client.GetDataAsync(Provider.Custom) as CustomResource;
InvokeOnMainThread(() =>
{
ValueOneLabel.Text = resource.ValueOne;
ValueTwolabel.Text = resource.ValueTwo;
consentWebView.RemoveFromSuperview();
});
});
task.Unwrap().ContinueWith((antecedent) =>
{
InvokeOnMainThread(() =>
{
var alert = UIAlertController.Create("Erreur", "Une erreur est survenue", UIAlertControllerStyle.Alert);
alert.AddAction(UIAlertAction.Create("Ok", UIAlertActionStyle.Cancel, null));
PresentViewController(alert, animated: true, completionHandler: null);
});
},
TaskContinuationOptions.OnlyOnFaulted);
return false;
}
return true;
};
}
开发者ID:FranceConnectSamples,项目名称:franceconnect-mobile-app-xamarin-native,代码行数:41,代码来源:CustomResourceViewController.cs