本文整理汇总了C#中WebView.Post方法的典型用法代码示例。如果您正苦于以下问题:C# WebView.Post方法的具体用法?C# WebView.Post怎么用?C# WebView.Post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebView
的用法示例。
在下文中一共展示了WebView.Post方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
ViewGroup root = (ViewGroup)inflater.Inflate (Resource.Layout.fragment_webview_with_spinner, null);
// For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
// FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
root.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
loadingSpinner = root.FindViewById (Resource.Id.loading_spinner);
webView = root.FindViewById<WebView> (Resource.Id.webview);
webView.SetWebChromeClient (webChromeClient);
webView.SetWebViewClient (webViewClient);
webView.Post (() => {
if (CLEAR_CACHE_ON_LOAD) {
webView.ClearCache (true);
}
webView.Settings.JavaScriptEnabled = true;
webView.Settings.JavaScriptCanOpenWindowsAutomatically = false;
webView.LoadUrl (MAP_URL);
webView.AddJavascriptInterface (new MyMapJsi (Activity, savedInstanceState), MAP_JSI_NAME);
});
return root;
}
示例2: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var root = inflater.Inflate (Resource.Layout.fragment_webview_with_spinner, null);
// For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
// FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
root.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
loading_spinner = root.FindViewById<View> (Resource.Id.loading_spinner);
web_view = root.FindViewById<WebView> (Resource.Id.webview);
web_view.SetWebViewClient (new TagWebViewClient (Activity));
web_view.Post (() => {
web_view.Settings.JavaScriptEnabled = true;
web_view.Settings.JavaScriptCanOpenWindowsAutomatically = false;
try {
var url = "http://twitter.com/#!/search/{0}";
url = string.Format (url, Uri.EscapeDataString (search_string));
web_view.LoadUrl (url);
} catch (UnsupportedEncodingException ex) {
Log.Error ("MonoIO", "Could not construct the realtime search URL", ex);
}
});
return root;
}
示例3: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var root = inflater.Inflate (Resource.Layout.fragment_webview_with_spinner, null);
// For some reason, if we omit this, NoSaveStateFrameLayout thinks we are
// FILL_PARENT / WRAP_CONTENT, making the progress bar stick to the top of the activity.
root.LayoutParameters = new ViewGroup.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
loadingSpinner = root.FindViewById<View> (Resource.Id.loading_spinner);
webView = root.FindViewById<WebView> (Resource.Id.webview);
webView.SetWebViewClient (new BulletinWebViewClient (Activity));
webView.Post (() => {
webView.Settings.JavaScriptEnabled = true;
webView.Settings.JavaScriptCanOpenWindowsAutomatically = false;
webView.LoadUrl (BULLETIN_URL);
});
return root;
}