Here is im loading page in webview with url .When page is loaded i want to customize the hight of loaded page by ElementID.But not working
WebView mywebview = (WebView)FindViewById(Resource.Id.NimID);
Dialog = CustomProgressDialog.Show(this);
mywebview.Settings.BuiltInZoomControls = false;
mywebview.SetWebChromeClient(new WebChromeClient());
mywebview.SetWebViewClient(new CustomWebViewClient(this, Dialog));
mywebview.Settings.JavaScriptEnabled = true;
mywebview.FocusableInTouchMode = true;
mywebview.SetInitialScale(340);
mywebview.Settings.DomStorageEnabled = true;
strUrl="Something";
mywebview.LoadDataWithBaseURL(null, strURL, "text/html", "UTF-8", null
here is the class which i have created when the page is loaded the OnpagedFinished method is calling and foucs is also working but not customize of height of page is working.
public class CustomWebViewClient : WebViewClient
{
Android.App.Dialog Dialog;
[Obsolete]
public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
return base.ShouldOverrideUrlLoading(view, url);
}
public CustomWebViewClient(NimIdLoginActivity mainActivity, Dialog dialog)
{
mActivity = mainActivity;
Dialog = dialog;
}
public override void OnPageFinished(WebView view, string url)
{
Dialog.Dismiss();
view.RequestFocus(FocusSearchDirection.Down);
//I have try this but not working to set the height of div.
view.loadUrl( "javascript:(function(){document.getElementById('nui').style.height='1000px'})()");
base.OnPageFinished(view, url);
}
public override bool ShouldOverrideUrlLoading(WebView view, IWebResourceRequest request)
{
return base.ShouldOverrideUrlLoading(view, request);
}
public override WebResourceResponse ShouldInterceptRequest(WebView view, IWebResourceRequest request)
{
return base.ShouldInterceptRequest(view, request);
}
}