简体   繁体   English

我应该在这个简单的iPhone应用程序中使用哪种类型的ViewController

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

I'm trying to make my first Xamarin iPhone app. 我正在尝试制作我的第一个Xamarin iPhone应用程序。 I have 2 views right now and i'm not sure how to be wire it up and then switch to the 2nd one. 我现在有2个视图,我不确定如何将其连接起来然后切换到第二个视图。

  1. AuthenticationViewController . AuthenticationViewController This is a simple login/create account view. 这是一个简单的登录/创建帐户视图。
  2. TabbedViewController . 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. 现在,我正在设置root = new AuthenticationViewController ,并且工作正常。 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)? 还是应该使用storyboard (在这里我认为这太过分了)来完成所有这些工作?

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 . 一种可能性是UINavigationController You can create an empty UINavigationController with your AuthenticationViewController as Root. 您可以使用AuthenticationViewController作为Root创建一个空的UINavigationController When the authentication succeeded, you can push your new ViewController (which is the TabbedViewController ) on the stack. 身份验证成功后,可以将新的ViewController(即TabbedViewController )推入堆栈。 If you have a log-off in your TabbedViewController , you come back by PopViewController . 如果您在TabbedViewController注销,则可以通过PopViewController

The other alternative is the PresentModalViewController . 另一个选择是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. 这可以是任何东西,特别是对此我认为FlipView-Animation并不是一个坏选择。

All this exists in Xamarin like in iOS. 所有这些都存在于Xamarin中,就像iOS中一样。

StoryBoard is doing the same thing but visualizes what should happen underneath. StoryBoard正在做同样的事情,但可视化了下面应该发生的事情。 (like InterfaceBuilder for the ViewController itself). (例如ViewController本身的InterfaceBuilder)。

At least in objective-c you can change the root view controller of the window without problems. 至少在Objective-C中,您可以毫无问题地更改窗口的根视图控制器。 The only drawback is that you cannot apply transitions doing things this way. 唯一的缺点是您不能以这种方式应用过渡服务器。 But it is totally fine to do so. 但是这样做完全没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该使用哪个SDK版本的iPhone应用程序? 4.2还是3? - What sdk version of iPhone app should I use? 4.2 or 3.? 我应该使用什么设备来测试iPhone应用程序 - What device should I use to test the iphone app 我应该在 ios 的日记应用程序中使用什么类型的数据库? - What type of database should I use in diary app in ios? 我应该为我的ios应用程序使用什么类型的数据存储? - What type of data store should I use for my ios app? 我应该使用哪种类型? - What type should I use? 我应该为我的iPhone应用程序使用哪种类型的“无网络连接”警告 - Which type of “No Network Connectivity” warning should I use for my iPhone App 我可以将UITabBarController用作简单的viewController切换器吗? - Can I use UITabBarController as a simple viewController switcher? 我应该在DroneDeploy应用中使用哪些样式? - What styles should I use in a DroneDeploy App? 我应该用什么来制作这种单元格,以便可以让每个单元格缝到不同的ViewController? - What should I use to make this kind of cell, so I can get each of them to segue to different ViewController? 我应该使用什么版本的Xcode在iPhone 3gs设备6.1.2上运行我的应用程序(10B146) - What version of Xcode should i use to run my App on iPhone 3gs device 6.1.2 (10B146)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM