Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 要从Xamarin表单中的自定义呈现器类加载webView吗_Android_Xamarin_Android Webview_Xamarin.forms - Fatal编程技术网

Android 要从Xamarin表单中的自定义呈现器类加载webView吗

Android 要从Xamarin表单中的自定义呈现器类加载webView吗,android,xamarin,android-webview,xamarin.forms,Android,Xamarin,Android Webview,Xamarin.forms,我的主屏幕上有两个选项卡,其中一个选项卡显示地图,当我单击地图pin时,它会打开一个信息窗口,我想单击此窗口并加载带有一些url内容的webview,而不隐藏屏幕顶部的选项卡栏 我可以在新活动中加载webview时执行此操作,但它会隐藏顶部的选项卡栏(表单的材质设计) 在iOS中,这很简单,我在自定义渲染类中做了如下操作 void OnCalloutAccessoryControlTapped (object sender, MKMapViewAccessoryTappedEventArgs e

我的主屏幕上有两个选项卡,其中一个选项卡显示地图,当我单击地图pin时,它会打开一个信息窗口,我想单击此窗口并加载带有一些url内容的webview,而不隐藏屏幕顶部的选项卡栏

我可以在新活动中加载webview时执行此操作,但它会隐藏顶部的选项卡栏(表单的材质设计)

在iOS中,这很简单,我在自定义渲染类中做了如下操作

void OnCalloutAccessoryControlTapped (object sender, MKMapViewAccessoryTappedEventArgs e) {
var temp = (uiview)this 
temp.addSubView(mywebview)
}
我想从android上实现同样的目标 我也试过类似的方法

void OnInfoWindowClick (object sender, GoogleMap.InfoWindowClickEventArgs e)
        {
            var customPin = GetCustomPin (e.Marker);
            if (customPin == null) {
                throw new Exception ("Custom pin not found");
            }

            if (!string.IsNullOrWhiteSpace (customPin.Url)) {
                var url = Android.Net.Uri.Parse (customPin.Url+"/app/auswahl-speisen.php");
//              var webActivity = new Intent (this.Context, typeof(WebViewFragment));
//              webActivity.PutExtra ("Shop Url",url.ToString() );
                var inflater = Android.App.Application.Context.GetSystemService (Context.LayoutInflaterService) as Android.Views.LayoutInflater;
                if (inflater != null) {
                    Android.Views.View view;
                    view = inflater.Inflate (Resource.Layout.WebViewLayout, null);
                    myWebView = view.FindViewById<Android.Webkit.WebView> (Resource.Id.webview);
                    myWebView.Settings.JavaScriptEnabled = true;
                    myWebView.Settings.LoadWithOverviewMode =false;
                    myWebView.Settings.UseWideViewPort = false;
                    myWebView.Settings.BuiltInZoomControls = false;
                    myWebView.Settings.AllowFileAccess = true;
                    myWebView.Settings.DomStorageEnabled = true;
                    myWebView.Settings.JavaScriptCanOpenWindowsAutomatically = true;
                    myWebView.LoadUrl (url.ToString());
                    myWebView.SetWebViewClient(new MyWebClient ());
//trail first
                    var me = this.ViewGroup;
                    me.AddView (myWebView);
//trial second
//this.AddView(myWebview)
                }
            }
        }
void OnInfoWindowClick(对象发送者,GoogleMap.InfoWindowClickEventArgs e)
{
var customPin=GetCustomPin(即标记);
如果(customPin==null){
抛出新异常(“未找到自定义pin”);
}
如果(!string.IsNullOrWhiteSpace(customPin.Url)){
var url=Android.Net.Uri.Parse(customPin.url+“/app/auswahl-speisen.php”);
//var webActivity=newintent(this.Context,typeof(WebViewFragment));
//webActivity.PutExtra(“商店Url”,Url.ToString());
var inflater=Android.App.Application.Context.GetSystemService(Context.LayoutInflaterService)作为Android.Views.LayoutInflater;
如果(充气机!=null){
Android.Views.View;
视图=充气机。充气(Resource.Layout.WebViewLayout,null);
myWebView=view.findviewbyd(Resource.Id.webview);
myWebView.Settings.JavaScriptEnabled=true;
myWebView.Settings.LoadWithOverviewMode=false;
myWebView.Settings.UseWideViewPort=false;
myWebView.Settings.BuiltinzoomControl=false;
myWebView.Settings.AllowFileAccess=true;
myWebView.Settings.DomStorageEnabled=true;
myWebView.Settings.JavaScriptCanOpenWindowsAutomatically=true;
myWebView.LoadUrl(url.ToString());
SetWebViewClient(新的MyWebClient());
//先试
var me=this.ViewGroup;
me.AddView(myWebView);
//第二次审判
//this.AddView(myWebview)
}
}
}
在安卓系统中,这段代码什么都不做,只是什么都不做

所以我想知道,如何用webview替换mapview,或者在上面添加webview

我是安卓的新手,我假设我可以通过android.views.view摆脱这些碎片