0

I followed the instructions from Xamarin University (unfortunately they've disabled comments so I can't discuss it with anyone)

the first viewcontroller has a storyboard id of "viewController" and the second one I'm trying to switch to has a storyboard id of "AndraViewController".

partial void Knapp1_TouchUpInside(UIButton sender)
{
    UIStoryboard storyboard = this.Storyboard;
    AndraViewController viewController = (AndraViewController)
    storyboard.InstantiateViewController("AndraViewController");

    this.PresentViewController(viewController, true, null);

}

When I press the button nothing happens, I don't receive an error message or anything.

Draken
  • 3,134
  • 13
  • 34
  • 54
  • It seems ok, double check if the storyboard ID "AndraViewController" is really set in your Storyboard. Also, what happens if you try: this.NavigationController.PushViewController(viewController, true); – Elton Santana Aug 02 '18 at 15:22
  • I added the line of code you suggested, no errors, but still doesn't work. I'm guessing it has something to do with my Visual Studio then; some setting? – Axel Herbst Aug 02 '18 at 15:43
  • Have you checked if the Storyboard ID is really set on your Storyboard? – Elton Santana Aug 02 '18 at 16:16
  • Here are screenshots of my view controllers id's. I've tried checking and unchecking the "Use Storyboard ID" box but to no help https://imgur.com/a/cTa4ddL https://imgur.com/a/FXeI – Axel Herbst Aug 02 '18 at 17:05
  • Right! Is your other view controller Storyboard ID assigned with AndraViewController? – Elton Santana Aug 02 '18 at 17:08
  • It solved itself. I tried to launch the project with the IOS Simulator instead of the Xamarin Live Player - and it worked. However, thanks for your help! – Axel Herbst Aug 07 '18 at 13:30

0 Answers0