Forum Xamarin.iOS

Is it a possible to subclass a subclass of UIView in the Storyboard Designer?

CharlieFinlaysonCharlieFinlayson USUniversity ✭✭
edited July 2016 in Xamarin.iOS

I'm using the source for FMCalendar to create my own implementation of it. I've even enabled it as a Custom Component to be dragged, dropped and configured from the Storyboard Designer. This has been fine so far.

I now need to have two customized versions of FMCalendar. So here's what I try:

  1. Go to ViewController with FMCalendar UIView in Storyboard.
  2. Select FMCalendar UIView and change class to be DerivedCalendarView
  3. Culick on DerivedCalendarView.cs in my solution
  4. Set the inherited-from class to be FMCALENDAR, not UIVIEW
  5. Change the name of the DerivedCalendarView UIView in storyboard, then change it back to what it was. This is the trick I use to get the designer file to refresh.

That all works out, all correct namespaces and no red underlined errors. I then clean, build/rebuild but I receive the follow error for the ViewController that I just modified:

The type or namespace name 'DerivedCalendarView' does not exist in the namespace MyProject.iOS (are you missing an assembly reference?)

So why can't I do this? Is it just that you can only subclass UIView from the Storyboard? But not subclass other subclasses of UIView which you've already made? I haven't found any documentation regarding grandchild inheritance for UIViews. If this is the case then I may have to do it from code instead of the Storyboard Designer.


I should also note that if I try reopening the solution to fix the problem, my new DerivedCalendarView.cs and it's designer file appear grayed out the solution explorer.

Best Answer


  • CharlieFinlaysonCharlieFinlayson USUniversity ✭✭

    Okay, it all works now. So, I guess that answers my question. Now I need to figure out what's wrong with my Visual Studio.

Sign In or Register to comment.