Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.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
C# xamarin方法GetOrCreateRenderer()的替代方法_C#_Android_Xamarin_Xamarin.droid - Fatal编程技术网

C# xamarin方法GetOrCreateRenderer()的替代方法

C# xamarin方法GetOrCreateRenderer()的替代方法,c#,android,xamarin,xamarin.droid,C#,Android,Xamarin,Xamarin.droid,试图使用方法GetOrCreateRenderer(),但visual Studio表示,该方法未包含该方法的定义。可能是在较新的版本中删除了它,或者我没有使用正确的名称空间 loadingIndicatorPage.Parent = Xamarin.Forms.Application.Current.MainPage; loadingIndicatorPage.Layout(new Rectangle(0, 0,Xamarin.Forms.Application.Current.MainPag

试图使用方法GetOrCreateRenderer(),但visual Studio表示,该方法未包含该方法的定义。可能是在较新的版本中删除了它,或者我没有使用正确的名称空间

loadingIndicatorPage.Parent = Xamarin.Forms.Application.Current.MainPage;
loadingIndicatorPage.Layout(new Rectangle(0, 0,Xamarin.Forms.Application.Current.MainPage.Width,
Xamarin.Forms.Application.Current.MainPage.Height));
var renderer = loadingIndicatorPage.GetOrCreateRenderer(); //not recognized
_nativeView = renderer.View;
GetOrCreateRenderer()已弃用,现在请使用:

Platform.createRenderWithContext(视图,上下文)