无法放大WebView(Not able to Zoom in WebView)

我试图在Xamarin Application for Android中放大/缩小Webview控件。 我试图通过多点触控获得变焦。 下面的代码不起作用..

我的XAML代码:

<WebView android:id="@+id/WebView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" /> WebView.SetWebViewClient(new WebViewClient()); WebView.Settings.DefaultZoom = WebSettings.ZoomDensity.Far; WebView.Settings.SetSupportZoom(true); WebView.Settings.BuiltInZoomControls = true;

不确定有什么问题......没有找到任何解决方案..请帮忙。

注意:缩放功能适用于本地内容,但是当它加载互联网的网址时却没有。

谢谢!

I am trying to zoom in/out in Webview control in Xamarin Application for Android. I am trying to get the zoom through multitouch. Below code is not working..

My XAML code:

<WebView android:id="@+id/WebView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" /> WebView.SetWebViewClient(new WebViewClient()); WebView.Settings.DefaultZoom = WebSettings.ZoomDensity.Far; WebView.Settings.SetSupportZoom(true); WebView.Settings.BuiltInZoomControls = true;

not sure what is wrong... did not find any solution.. Please help.

Note: the zoom functionality works fine for local content but when it loads the url for internet it does not.

Thanks!

最满意答案

我已经将按钮单击功能移动到OnCreate方法,它工作正常。 多谢你们!!

I haved moved the button click functionality to OnCreate method and it is working fine. Thanks guys!!

无法放大WebView(Not able to Zoom in WebView)

我试图在Xamarin Application for Android中放大/缩小Webview控件。 我试图通过多点触控获得变焦。 下面的代码不起作用..

我的XAML代码:

<WebView android:id="@+id/WebView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" /> WebView.SetWebViewClient(new WebViewClient()); WebView.Settings.DefaultZoom = WebSettings.ZoomDensity.Far; WebView.Settings.SetSupportZoom(true); WebView.Settings.BuiltInZoomControls = true;

不确定有什么问题......没有找到任何解决方案..请帮忙。

注意:缩放功能适用于本地内容,但是当它加载互联网的网址时却没有。

谢谢!

I am trying to zoom in/out in Webview control in Xamarin Application for Android. I am trying to get the zoom through multitouch. Below code is not working..

My XAML code:

<WebView android:id="@+id/WebView" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" /> WebView.SetWebViewClient(new WebViewClient()); WebView.Settings.DefaultZoom = WebSettings.ZoomDensity.Far; WebView.Settings.SetSupportZoom(true); WebView.Settings.BuiltInZoomControls = true;

not sure what is wrong... did not find any solution.. Please help.

Note: the zoom functionality works fine for local content but when it loads the url for internet it does not.

Thanks!

最满意答案

我已经将按钮单击功能移动到OnCreate方法,它工作正常。 多谢你们!!

I haved moved the button click functionality to OnCreate method and it is working fine. Thanks guys!!