roubachof / Sharpnado.Tabs

Pure MAUI and Xamarin.Forms Tabs, including fixed tabs, scrollable tabs, bottom tabs, badge, segmented control, custom tabs, button tabs, bendable tabs...
MIT License
469 stars 60 forks source link

Invalid Generic Instantiation #23

Closed cdeck95 closed 3 years ago

cdeck95 commented 3 years ago

Bug: Invalid Instantiation of the LazyView for the tabs in the TabHostView object.

Steps to reproduce the behavior:

  1. Clone the repo
  2. Launch the iOS project
  3. See error

See exception/error screenshot below:

See the app.cs file & XAML files here:

If there is anything else you need to know, please let me know.

roubachof commented 3 years ago

Hi! LazyView takes as parameter types that inherit from View not ContentPage. Otherwise I guess I called it LazyPage :)

cdeck95 commented 3 years ago

Hi!

LazyView takes as parameter types that inherit from View not ContentPage.

Otherwise I guess I called it LazyPage :)

Thank you for your quick reply! Now that you say that, I did try to change it to ContentView, but got an error that all my variables and "initantiatecompoment() methods were invalid. Let me get a screenshot.

cdeck95 commented 3 years ago

@roubachof see screenshot. Do you know why this might be happening? I have tried everything I can think of, but I know its something simple.

EDIT: Found it. I have "ContentPage" as my main control in the XAML associated with the code-behind class, so it was yelling at my for the type mismatch. I have fixed it, no more errors. I hope this was all it was :)