• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# WebView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中WebView的典型用法代码示例。如果您正苦于以下问题:C# WebView类的具体用法?C# WebView怎么用?C# WebView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WebView类属于命名空间,在下文中一共展示了WebView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BrowserWindow

 public BrowserWindow()
 {
     rootTree = RootTree.LoadTree(@"/Library/Frameworks/Mono.framework/Versions/Current/lib/monodoc");
     MonoDocWebRequest.RegisterWithRootTree(rootTree);
     treeView = new DocTreeView(rootTree);
     treeView.SelectionChanged += treeView_SelectionChanged;
     scrollView = new ScrollView() { Scrollers = Axis.Both };
     scrollView.DocumentView = treeView;
     webView = new WebView();
     //			splitView = new SplitView()
     //			{
     //				Margin = new Thickness(0, 0, 0, Window.SmallBottomBarHeight),
     //				Width = double.NaN,
     //				Height = double.NaN,
     //				Orientation = Orientation.Horizontal,
     //				DividerStyle = DividerStyle.Thin,
     //			};
     //			splitView.Children.Add(scrollView);
     //			splitView.Children.Add(webView);
     //			Content.Children.Add(splitView);
     scrollView.HorizontalAlignment = HorizontalAlignment.Left;
     scrollView.Width = 250;
     scrollView.Margin = new Thickness(4, 4, 4, Window.SmallBottomBarHeight + 4);
     webView.HorizontalAlignment = HorizontalAlignment.Right;
     webView.Margin = new Thickness(258, 4, 4, Window.SmallBottomBarHeight + 4);
     Content.Children.Add(scrollView);
     Content.Children.Add(webView);
     CreateToolbarTemplate();
     Toolbar = new Toolbar() { Customizable = true, TemplateName = "Main" };
     BottomBarHeight = Window.SmallBottomBarHeight;
     Title = "Mono Documentation Browser";
 }
开发者ID:nagyist,项目名称:monoxide,代码行数:32,代码来源:BrowserWindow.cs


示例2: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            SetContentView (Resource.Layout.PlayAnimation);
            ImageView btns = FindViewById<ImageView> (Resource.Id.imgNewLoginHeader);
            TextView header = FindViewById<TextView> (Resource.Id.txtFirstScreenHeader);
            RelativeLayout relLayout = FindViewById<RelativeLayout> (Resource.Id.relativeLayout1);
            ImageHelper.setupTopPanel (btns, header, relLayout, header.Context);
            Header.headertext = Application.Context.Resources.GetString (Resource.String.animationPlaybackTitle);
            Header.fontsize = 36f;
            ImageHelper.fontSizeInfo (header.Context);
            header.SetTextSize (Android.Util.ComplexUnitType.Dip, Header.fontsize);
            header.Text = Header.headertext;

            animationView = FindViewById<WebView> (Resource.Id.animationView);

            ImageButton btnBack = FindViewById<ImageButton> (Resource.Id.btnBack);
            btnBack.Tag = 0;
            btnBack.Click += delegate {
                Finish ();
            };
            ImageButton btnPlay = FindViewById<ImageButton> (Resource.Id.btnPlay);
            btnPlay.Tag = 1;
            LinearLayout bottom = FindViewById<LinearLayout> (Resource.Id.bottomHolder);
            ImageButton[] buttons = new ImageButton[2];
            buttons [0] = btnBack;
            buttons [1] = btnPlay;
            ImageHelper.setupButtonsPosition (buttons, bottom, header.Context);
        }
开发者ID:chimpinano,项目名称:WowZapp-Android,代码行数:29,代码来源:PlayAnimation.cs


示例3: OnViewCreated

		public override void OnViewCreated (View view, Bundle savedInstanceState)
		{
			mWebView = (WebView)view.FindViewById (Resource.Id.web_view);
			// Here, we use #mWebChromeClient with implementation for handling PermissionRequests.
			mWebView.SetWebChromeClient (mWebChromeClient);
			ConfigureWebSettings (mWebView.Settings);
		}
开发者ID:GTmAster,项目名称:monodroid-samples,代码行数:7,代码来源:PermissionRequestFragment.cs


示例4: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            fb = new FacebookClient ();
            appId = Intent.GetStringExtra ("AppId");
            extendedPermissions = Intent.GetStringExtra ("ExtendedPermissions");
            url = GetFacebookLoginUrl (appId, extendedPermissions);

            WebView webView = new WebView(this);
            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.SetSupportZoom(true);
            webView.Settings.BuiltInZoomControls = true;
            webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
            webView.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
            webView.ScrollbarFadingEnabled = true;

            webView.VerticalScrollBarEnabled = true;
            webView.HorizontalScrollBarEnabled = true;

            webView.SetWebViewClient(new FBWebClient (this));
            webView.SetWebChromeClient(new FBWebChromeClient (this));

            AddContentView(webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));

            webView.LoadUrl(url);
        }
开发者ID:dmerrill6,项目名称:MidgardMessenger,代码行数:27,代码来源:FBWebAuthActivity.cs


示例5: MainWindow

 public MainWindow()
 {
     CreateToolbarTemplate();
     Style |= WindowStyle.UnifiedTitleAndToolbar;
     Toolbar = new Toolbar() { TemplateName = "Main", Customizable = true };
     button1 = new Button() { Title = "Click me \u263A", Width = 100, Margin = new Thickness(0, 0, 200, 0), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom };
     button1.Action += HandleButton1Action;
     button2 = new Button() { Title = "\u26A0 Don't click me \u2620", Width = 200, Margin = new Thickness(0, 0, 0, 0), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom };
     button2.Action += HandleButton2Action;
     checkBox = new Button() { Title = "Closable", ButtonType = ButtonType.Switch, Width = 100, Height = 24, Margin = new Thickness(120, 0, 0, 100), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Bottom };
     paintedView = new DrawableView() { Height = 100, Margin = new Thickness(0, 0, 0, 160), VerticalAlignment = VerticalAlignment.Bottom };
     paintedView.Draw += HandlePaintedViewDraw;
     webView = new WebView() { Margin = new Thickness(0, 0, 0, 260), VerticalAlignment = VerticalAlignment.Top };
     #if DOCUMENT
     //			checkBox.Checked = true;
     #endif
     Title = "Hello From C#";
     Content.Children.AddRange
     (
         button1,
         button2,
         checkBox,
         new ColorWell() { Width = 100, Height = 100, Margin = new Thickness(10, 0, 0, 32), HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Bottom },
         new ColorWell() { Width = 100, Height = 100, Margin = new Thickness(0, 0, 10, 32), HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Bottom },
         new SearchField() { Width = double.NaN, Height = 22, Margin = new Thickness(120, 0, 120, 32), HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Bottom },
         new TextField() { Height = 22, Margin = new Thickness(120, 0, 120, 64), HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Bottom },
         new ComboBox() { Height = 22, Margin = new Thickness(10, 0, 10, 132), HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Bottom },
         paintedView,
         webView
     );
 }
开发者ID:nagyist,项目名称:monoxide,代码行数:31,代码来源:MainWindow.cs


示例6: Init

		protected override void Init()
		{

			var notWorkingHtml = @"<html><body>
						<p><img src='test.jpg' /></p>
						<p>After starting (not re-entering!) the app in landscape, scroll down to see a black area which is not supposed to be there.</p>
						<p>After starting (not re-entering!) the app in portrait, scroll to the right to see a black area which is not supposed to be there.</p>
						<p>This only happends when a local image is loaded.</p>
						</body></html>";

			var workingHtml = @"<html><body>
						<p></p>
						<p>Without local image, everything works fine.</p>
						</body></html>";

			// Initialize ui here instead of ctor
			WebView webView = new WebView {
				//Source = new UrlWebViewSource {
				//	Url = "https://blog.xamarin.com/",
				//},
				Source = new HtmlWebViewSource() {
					Html = notWorkingHtml
				},
				VerticalOptions = LayoutOptions.FillAndExpand,
				HorizontalOptions = LayoutOptions.FillAndExpand
			};

			Content = webView;
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:29,代码来源:Bugzilla39963.cs


示例7: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            _messageHub = Mvx.Resolve<IMvxMessenger>();

            var url = Intent.GetStringExtra("cheesebaron.mvxplugins.azureaccesscontrol.droid.Url");

            Window.RequestFeature(WindowFeatures.Progress);

            _webView = new WebView(this)
            {
                VerticalScrollBarEnabled = true,
                HorizontalScrollBarEnabled = true,
                ScrollBarStyle = ScrollbarStyles.OutsideOverlay,
                ScrollbarFadingEnabled = true
            };

            _webView.Settings.JavaScriptEnabled = true;
            _webView.Settings.SetSupportZoom(true);
            _webView.Settings.BuiltInZoomControls = true;
            _webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
            
            var notify = new AccessControlJavascriptNotify();
            notify.GotSecurityTokenResponse += GotSecurityTokenResponse;

            _webView.AddJavascriptInterface(notify, "external");
            _webView.SetWebViewClient(new AuthWebViewClient());
            _webView.SetWebChromeClient(new AuthWebChromeClient(this));

            _webView.LoadUrl(url);

            AddContentView(_webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent));
        }
开发者ID:kstreet,项目名称:Cheesebaron.MvxPlugins,代码行数:34,代码来源:AccessControlWebAuthActivity.cs


示例8: OnPageStarted

        public override void OnPageStarted(WebView view, string url, Android.Graphics.Bitmap favicon)
        {
            base.OnPageStarted(view, url, favicon);

            _urlText.Text = url;
            _urlText.SetSelection(0);
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:7,代码来源:CustomWebViewClient.cs


示例9: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);
            //"a16fe3fa136e7b54b24664bb2a3c647e"
            ColorDrawable colorDrawable = new ColorDrawable (Color.ParseColor (Helpers.ColorHeader));
            ActionBar.SetBackgroundDrawable (colorDrawable);

            //fb = new FacebookClient ();
            appId = Intent.GetStringExtra ("AppId");
            extendedPermissions = Intent.GetStringExtra ("ExtendedPermissions");
            url = GetFacebookLoginUrl (appId, extendedPermissions);

            WebView webView = new WebView(this);
            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.SetSupportZoom(true);
            webView.Settings.BuiltInZoomControls = true;
            webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
            webView.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
            webView.ScrollbarFadingEnabled = true;

            webView.VerticalScrollBarEnabled = true;
            webView.HorizontalScrollBarEnabled = true;

            webView.SetWebViewClient(new FBWebClient (this));
            webView.SetWebChromeClient(new FBWebChromeClient (this));

            AddContentView(webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));

            webView.LoadUrl(url);
        }
开发者ID:jhondiaz,项目名称:Viewwin,代码行数:30,代码来源:FBWebViewAuthActivity.cs


示例10: ShouldInterceptRequest

        public override WebResourceResponse ShouldInterceptRequest(WebView view, IWebResourceRequest request)
        {
            if (request.Url.Scheme == Uri.UriSchemeFile)
                return null;

            if (SkipLoading(request.Url.LastPathSegment))
                return null;

            var baseResponse = base.ShouldInterceptRequest(view, request);

            try
            {
                var result = Task.Run(async () =>
                {
                    using (var c = new HttpClient { Timeout = TimeSpan.FromSeconds(TimeOut) })
                    {
                        var response = await c.GetAsync(request.Url.ToString());
                        var content = await response.Content.ReadAsStreamAsync();
                        return new WebResourceResponse(baseResponse.MimeType, "UTF-8", (int)response.StatusCode, response.ReasonPhrase, null, content);
                    }
                }).Result;
                
                return result;
            }
            catch (AggregateException e)
            {
                return baseResponse;
            }
        }
开发者ID:samiy-xx,项目名称:KeySndr.Clients,代码行数:29,代码来源:CustomWebClient.cs


示例11: OnViewModelSet

        protected override void OnViewModelSet()
        {
            Window.RequestFeature(WindowFeatures.Progress);
            SupportActionBar.SetDisplayHomeAsUpEnabled(true);
            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetBackgroundDrawable(Resources.GetDrawable(Resource.Color.s_main_green));
            SupportActionBar.SetLogo(Resource.Drawable.logo_white);

            base.OnViewModelSet();

            SetContentView(Resource.Layout.page_webview);

            
            var set = this.CreateBindingSet<GenericWebViewView, GenericWebViewViewModel>();
            set.Bind(SupportActionBar).For(v => v.Title).To(vm => vm.Title).Mode(MvxBindingMode.OneWay);
            set.Apply();


            _webView = FindViewById<WebView>(Resource.Id.webView);
            _webView.Settings.JavaScriptEnabled = true;
            _webView.Settings.SetSupportZoom(true);


            var progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar);
            var webChromeClient = new ProgressUpdatingWebChromeClient(progressBar);
            var webViewClient = new ProgressHandlingWebViewClient(progressBar);
            _webView.SetWebViewClient(webViewClient);
            _webView.SetWebChromeClient(webChromeClient);
    
            _webView.LoadUrl(ViewModel.Uri);
        }
开发者ID:khellang,项目名称:Solvberget,代码行数:31,代码来源:GenericWebViewView.cs


示例12: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            var downloadButton = FindViewById<Button>(Resource.Id.downloadButton);
            FindViewById<Button>(Resource.Id.backButton).Click += (sender, args) => { if (_webView.CanGoBack()) _webView.GoBack(); };
            FindViewById<Button>(Resource.Id.forwardButton).Click += (sender, args) => { if (_webView.CanGoForward()) _webView.GoForward(); };
            _webView = FindViewById<WebView>(Resource.Id.webView1);
            var progressBar = FindViewById<ProgressBar>(Resource.Id.progressBar1);
            var title = FindViewById<TextView>(Resource.Id.textView1);
            var frame = FindViewById(Resource.Id.frameDownload);
            frame.Visibility = ViewStates.Gone;
            var viewControls = new ViewControls {
                DownloadButton = downloadButton,
                ProgressBar = progressBar,
                Title = title,
                DownloadFrame = frame,
                Activity = this
            };
            _webView.Settings.JavaScriptEnabled = true;
            _webView.SetWebViewClient(new YoutubeWebViewClient(viewControls));
            _webView.LoadUrl("http://www.youtube.com/");
        }
开发者ID:x011,项目名称:ms.video.downloader.android,代码行数:25,代码来源:Activity1.cs


示例13: collectDevice

        public static void collectDevice()
        {
            string SessionId = Conekta.DeviceFingerPrint ();
            string PublicKey = Conekta.PublicKey;
            string html = "<!DOCTYPE html><html><head></head><body style=\"background: blue;\">";
            html += "<script type=\"text/javascript\" src=\"https://conektaapi.s3.amazonaws.com/v0.5.0/js/conekta.js\" data-conekta-public-key=\"" + PublicKey + "\" data-conekta-session-id=\"" + SessionId + "\"></script>";
            html += "</body></html>";

            string contentPath = Environment.CurrentDirectory;

            #if __IOS__
            UIWebView web = new UIWebView(new RectangleF(new PointF(0,0), new SizeF(0, 0)));
            web.ScalesPageToFit = true;
            web.LoadHtmlString(html, new NSUrl("https://conektaapi.s3.amazonaws.com/v0.5.0/js/conekta.js"));
            Conekta._delegate.View.AddSubview(web);
            #endif

            #if __ANDROID__
            WebView web_view = new WebView(Android.App.Application.Context);
            web_view.Settings.JavaScriptEnabled = true;
            web_view.Settings.AllowContentAccess = true;
            web_view.Settings.DomStorageEnabled = true;
            web_view.LoadDataWithBaseURL(Conekta.UriConektaJs, html, "text/html", "UTF-8", null);
            #endif
        }
开发者ID:conekta,项目名称:conekta-xamarin,代码行数:25,代码来源:Conekta.cs


示例14: ReceivedErrorEventArgs

 public ReceivedErrorEventArgs(WebView webView, ClientError errorCode, string description, string failingUrl)
 {
     this.WebView = webView;
     this.ErrorCode = errorCode;
     this.Description = description;
     this.FailingUrl = failingUrl;
 }
开发者ID:mattleibow,项目名称:Android.Extensions,代码行数:7,代码来源:ReceivedErrorEventArgs.cs


示例15: Reload

		public override void Reload (WebView _webview)
		{
			base.Reload(_webview);
			
			// Feature isnt supported
			Console.LogError(Constants.kDebugTag, Constants.kFeatureNotSupported);
		}
开发者ID:noahzaozao,项目名称:UnityAdmobAppEventDemo,代码行数:7,代码来源:WebViewNativeEditor.cs


示例16: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var url = Intent.GetStringExtra("monodroid.watoolkit.library.login.url");

            System.Diagnostics.Debug.WriteLine(url);

            Window.RequestFeature(WindowFeatures.Progress);

            var webView = new WebView(this);

            webView.Settings.JavaScriptEnabled = true;
            webView.Settings.SetSupportZoom(true);
            webView.Settings.BuiltInZoomControls = true;
            webView.Settings.LoadWithOverviewMode = true; //Load 100% zoomed out
            webView.ScrollBarStyle = ScrollbarStyles.OutsideOverlay;
            webView.ScrollbarFadingEnabled = true;

            webView.VerticalScrollBarEnabled = true;
            webView.HorizontalScrollBarEnabled = true;

            var notify = new AccessControlJavascriptNotify();
            notify.GotSecurityTokenResponse += GotSecurityTokenResponse;

            webView.AddJavascriptInterface(notify, "external");
            webView.SetWebViewClient(new AuthWebViewClient());
            webView.SetWebChromeClient(new AuthWebChromeClient(this));
            
            webView.LoadUrl(url);

            AddContentView(webView, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
        }
开发者ID:Cheesebaron,项目名称:MonoDroid.WAToolkit,代码行数:33,代码来源:AccessControlWebAuthActivity.cs


示例17: OnCreate

		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			_pdfPath = _documentsPath + "/PDFView";
			_pdfFilePath  = Path.Combine(_pdfPath, _pdfFileName);

			// Check if the PDFDirectory Exists
			if(!Directory.Exists(_pdfPath)){
				Directory.CreateDirectory(_pdfPath);
			}
			else{
				// Check if the IDCard is there, If Yes Delete It. Because we will download the fresh one just in a moment
				if (File.Exists(_pdfFilePath)){
					File.Delete(_pdfFilePath);
				}
			}

			_webView = FindViewById<WebView> (Resource.Id.webView1);
			var settings = _webView.Settings;
			settings.JavaScriptEnabled = true;
			settings.AllowFileAccessFromFileURLs = true;
			settings.AllowUniversalAccessFromFileURLs = true;
			settings.BuiltInZoomControls = true;
			_webView.SetWebChromeClient(new WebChromeClient());
			_webView.LoadUrl("file:///android_asset/PDFViewer/index.html?file=" + _pdfFilePath);
		}
开发者ID:krikech,项目名称:Xamarin.PDFView,代码行数:29,代码来源:MainActivity.cs


示例18: OnProgressChanged

        public override void OnProgressChanged(WebView view, int newProgress)
        {
            base.OnProgressChanged(view, newProgress);

            _context.SetProgress(newProgress * 100);

            if (newProgress == 100)
            {
                _context.Title = view.Title;

                bool soundEnabled = PreferenceManager.GetDefaultSharedPreferences(_context.ApplicationContext).GetBoolean("sounds", false);

                if (soundEnabled)
                {
                    _mediaPlayer = MediaPlayer.Create(_context.ApplicationContext, Resource.Raw.inception_horn);
                    _mediaPlayer.Completion += delegate { _mediaPlayer.Release(); };
                    _mediaPlayer.Start();
                }

                // add this page to the history
                using (SQLiteDatabase db = _historyDataHelper.WritableDatabase)
                {
                    var values = new ContentValues();
                    values.Put("Title", view.Title);
                    values.Put("Url", view.Url);
                    values.Put("Timestamp", DateTime.Now.Ticks);

                    db.Insert("history", null, values);
                }
            }
            else
            {
                _context.Title = _context.ApplicationContext.Resources.GetString(Resource.String.title_loading);
            }
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:35,代码来源:CustomWebChromeClient.cs


示例19: onCreate

        /// <summary>
        /// Construct the UI and start loading
        /// </summary>
		public void onCreate()
		{
			string startUrl = webSettings.GetString ("url");
			string title = webSettings.GetString ("title");
			mainLayout = new LinearLayout (this.context);
			LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, 0.0F);
			mainLayout.LayoutParameters = lp;
			((LinearLayout)mainLayout).SetGravity (GravityFlags.CenterVertical);
			((LinearLayout)mainLayout).Orientation = Orientation.Vertical;

			webView = new WebView (this.context);
			WebSettings settings = webView.Settings;
			settings.JavaScriptEnabled = true;
			settings.BuiltInZoomControls = true;
			settings.JavaScriptCanOpenWindowsAutomatically = true;

			webView.LayoutParameters = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent, 1.0F);

			webView.SetWebViewClient (new FHOAuthWebViewClient (this));
			webView.RequestFocusFromTouch ();
			webView.Visibility = ViewStates.Visible;

			LinearLayout barlayout = initHeaderBar (title);

			mainLayout.AddView (barlayout);
			mainLayout.SetBackgroundColor (Color.Transparent);
			mainLayout.SetBackgroundResource (0);
			mainLayout.AddView (this.webView);

			this.webView.LoadUrl (startUrl);

		}
开发者ID:secondsun,项目名称:fh-dotnet-sdk,代码行数:35,代码来源:FHOAuthWebview.cs


示例20: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.WebViewInterop);

            wv = FindViewById<WebView>(Resource.Id.Web);
            wv.Settings.JavaScriptEnabled = true;

            // wire up the c#-to-javascript button
            RunScriptButton = FindViewById<Button>(Resource.Id.RunScriptButton);
            RunScriptButton.Click += (s, e) => {
                wv.LoadUrl("javascript:RunAction();");
                wv.LoadUrl("javascript:SetContent('Yay for content from C#');");
            };

            wv.LoadUrl("file:///android_asset/Content/InteractivePages/Home.html");
            
            wv.SetWebViewClient(new MonkeyWebViewClient(this));
            wv.SetWebChromeClient(new MonkeyWebChromeClient());     // required for javascript:alert() handling

            // allow zooming/panning
            wv.Settings.BuiltInZoomControls = true;
            wv.Settings.SetSupportZoom(true);

            // we DON'T want the page zoomed-out, since it is phone-sized content
            wv.Settings.LoadWithOverviewMode = false;
            wv.Settings.UseWideViewPort = false;

            // scrollbar stuff
            wv.ScrollBarStyle = ScrollbarStyles.OutsideOverlay; // so there's no 'white line'
            wv.ScrollbarFadingEnabled = false;
        }
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:33,代码来源:WebViewInteropScreen.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Web_Language_Enum类代码示例发布时间:2022-05-24
下一篇:
C# WebTestRequest类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap