TabView in XAML
See original GitHub issueHi,
I tried to add TabView to my solution. Everything is fine as long as I add the TabView from my code as shown in the sample.
But when I add it like this to my XAML:
<tvs:TabViewControl HeaderTabTextFontSize="Default"> <tvs:TabViewControl.ItemSource> <tvs:TabItem HeaderText="First Tab"> <Button Text="Go back to main page from first page"/> </tvs:TabItem> <tvs:TabItem HeaderText="Second Tab"> <Button Text="Go back to main page from second page"/> </tvs:TabItem> <tvs:TabItem HeaderText="Third Tab"> <Button Text="Go back to main page from third page" /> </tvs:TabItem> </tvs:TabViewControl.ItemSource> </tvs:TabViewControl>
I get the following exception: System.MissingMethodException: Default constructor not found for type Xam.Plugin.TabView.TabItem as soon as the page loads.
I also added
CarouselViewRenderer.Init();
to the Android project.
Did I forget a step to get it working.
Thank you for your help.
Thomas
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
I know that I’m a little late but just today I’ve used this library and I got the same problem… Nuget package version now is 1.0.3 which is older than the current code on GitHub… The nuget code does not include any parameterless constructors for TabView and for TabItem classes.
To solve this problem you can build the current code from GitHub and use it in your project (They already added parameterless constructors for TabView and for TabItem classes.).
Or you can do what I did in my project… Create to classes that inherits from TabView and TabItem, and add parameterless constructors like this:
Now you can use it normally in your XAML files:
Please tell me if it is working…
Happy it worked for you @AmorimRob ….