I am creating my first Xamarin-application (C#) in iOS and I am having trouble with navigating in storyboard. All of my tabbar-,navigation- and viewcontrollers are in the storyboard. In almost every viewcontroller, I added a menu (Facebook- and YouTube-style) which slides from the side. From there it has to be possible to return to the first viewcontroller (home) in storyboard. Because the menu is active in almost every controller of my application, I don't use segues (It would be a mess in my storyboard).
So I would want to use PresentViewController(), but when I do this, the page turnes black and doesn't show anything.
homeViewController home = new homeViewController();
PresentViewController(home, true, null);
Does it turn black because PresentViewController expects a XIB-file from the homeViewController? I want the user to stay in the storyboard, so he can continue by segueing through my application.
Does someone has an idea?
Thanks in advance.
Did you create the empty constructor yourself? If so, then its not loading the information from the storyboard, which is why it's black.
To create the controller call this:
var controller = Storyboard.InstantiateViewController("HomeViewController") as UIViewController;
You will also have to open the controller in XCode and set its "Storyboard ID" to "HomeViewController". This is the second tab from the left (I think) in the details pane. The same tab where you change the class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With