1
votes

I am trying to experiment with Native Forms in XF. I have this in iOS working right. That is fine.

In Android, I am getting the following error:

'MainPage' does not contain a definition for 'CreateSupportFragment' and the best extension method overload 'PageExtensions.CreateSupportFragment(ContentPage, Context)' requires a receiver of type 'ContentPage'

The code is erroring in the following code:

var _cp = new MainPage(); // my page from XF.
_list = _cp.CreateSupportFragment(this);

I have made sure that my nuget packages are up to date. I have cleaned and compiled. I've done a bunch of things, but alas, no love. Any ideas on this?

TIA

1
check this out blog.xamarin.com/…FreakyAli
Thanks, however, I started from that blog post. I am looking for why the error is occurring. Is it due to some nuget package from xamarin that I have not included? Their documentation on this is not the best.Wallace B. McClure
Okay goodluck incase you find a solution do post it hereFreakyAli
What version of Xamarin Forms are you using Wallace B. McClure?Chucky

1 Answers

0
votes

you need add the line to head of source:

using Xamarin.Forms.Platform.Android

because CreateSupportFragment is an extension method defined in it.