简体   繁体   中英

What type of ViewController should I use in this simple iPhone app

I'm trying to make my first Xamarin iPhone app. I have 2 views right now and i'm not sure how to be wire it up and then switch to the 2nd one.

  1. AuthenticationViewController . This is a simple login/create account view.
  2. TabbedViewController . A few sub views all connected by a tab controller. eg. listview, settings and about/info.

right now, i'm setting the root = new AuthenticationViewController and that works fine. just not sure how to swap roots and if this is the correct way to do things.

or should this all be done with a storyboard (which i think is an overkill, here)?

The user should always understand where he is. For that Apple suggests animations removing old content and showing new content. One possibility is the UINavigationController . You can create an empty UINavigationController with your AuthenticationViewController as Root. When the authentication succeeded, you can push your new ViewController (which is the TabbedViewController ) on the stack. If you have a log-off in your TabbedViewController , you come back by PopViewController .

The other alternative is the PresentModalViewController . In the appearing controller you define the modal transitions style. This can be anything and especially for this a FlipView-Animation is in my opinion not a bad choice.

All this exists in Xamarin like in iOS.

StoryBoard is doing the same thing but visualizes what should happen underneath. (like InterfaceBuilder for the ViewController itself).

At least in objective-c you can change the root view controller of the window without problems. The only drawback is that you cannot apply transitions doing things this way. But it is totally fine to do so.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM