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


C# WebView.Post方法代码示例

本文整理汇总了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;
			
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:27,代码来源:MapFragment.cs

示例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;
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:30,代码来源:TagStreamFragment.cs

示例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;
		}
开发者ID:BratislavDimitrov,项目名称:monodroid-samples,代码行数:21,代码来源:BulletinFragment.cs


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