草庐IT

RootviewController

全部标签

objective-c - iOS 编程 : Understand UINavigationController and the RootViewController

我正在阅读Apple文档,但我不明白根Controller是什么。文档说这是堆栈底部的Controller。也许,这是我第一次推送的Controller?谁能解释一下这个概念?来自Apple文档UINavigationController,我看到有一个方法叫做initWithRootViewControllerInitializesandreturnsanewlycreatednavigationcontroller.-(id)initWithRootViewController:(UIViewController*)rootViewController这是什么意思?那么,是否可以更改

iphone - 如何将 UIViewController 作为 subview 添加到 UIViewController(RootViewController)?

我有一个名为LoginViewController的UIViewController,它是AppDelegate中的一个rootViewController。在LoginViewController中,我有两个按钮:Login和Enroll。当我点击Login时,我将TabBarController指定为rootViewController,然后显示TabBarController。但是,现在我认为我需要在点击Enroll时添加另一个UIViewcController作为subview。我尝试了以下方法:[self.viewaddsubview:viewcontroller.view]

iphone - RootViewController 可以实例化 Storyboard吗?

我有一个RootViewController,它包含一个viewController数组,其中包括表、View和tabBarController......其中一些有Nib,一些没有,(我结合了几个应用程序的功能+创建的网络应用程序过去),但它们都工作正常。但是,我有一个项目使用Storyboard。我看到很多问题询问有关从Storyboard中实例化编程View的问题,但是反过来呢?如何将Storyboard添加到我以编程方式实现的导航Controller?这可能吗?如果没有,下一个最佳解决方法是什么?感谢您的时间和考虑。这是我的以下模型的.h代码:UIStoryboard*stor

ios - 将 rootViewController 从 uiviewcontroller 更改为 uinavigationcontroller

我正在开发一个使用MFsidemenu作为swipeBar的应用程序。我的应用程序由一个loginController组成,它是一个uiViewController,在登录后它变成了一个uiNavigationController。MFsidemenu需要在AppDelegate上运行此代码:UIStoryboard*storyboard=[UIStoryboardstoryboardWithName:@"MainStoryboard"bundle:[NSBundlemainBundle]];UINavigationController*navigationController=(UI

ios - rootViewController 已设置但显示方向不正确

我的情况和thisquestion很相似.我有一个通用的应用程序,其中iPhone为纵向,iPad为横向,我使用appDelegate.window.rootViewController=newScreen;在所有主屏幕之间切换。iPhone应用程序完美运行。iPad应用程序有时会以纵向而不是横向显示屏幕。下面是一些示例转换代码:AppDelegate*appDelegate=(AppDelegate*)[[UIApplicationsharedApplication]delegate];ViewController*v=nil;if(IS_IPAD()){v=[[ViewContro

iphone - 始终在 rootViewController 中打开应用程序

在我的应用程序中,我希望用户在应用程序打开时始终看到rootViewController的View,即使应用程序尚未完全终止也是如此。我考虑过的一种替代方法是在applicationWillResignActive:中调用abort(),但这似乎不是一个好的解决方案。有什么建议吗? 最佳答案 将您的Info.plist中的UIApplicationExitsOnSuspend设置为true。 关于iphone-始终在rootViewController中打开应用程序,我们在StackOv

iphone - 杀死 View 并返回到 rootViewController

我是IOS的新手,如果我问了一个愚蠢的问题,请提前道歉。我使用UITabBarController和navigationController来控制View。在我的最后一个View中,我希望在按下按钮时有一个按钮,View将返回到我通过MainWindow.xib文件设置的rootViewController并终止在应用程序后台运行的任何进程。这是我想返回到rootViewController之前最后一个View中的代码:-(IBAction)doneButtonPressed:(id)sender{JourneyIndexViewController*journeyIndexVC=[[

ios - UIWindow 的 rootViewController 注意事项

我一直在阅读一些关于切换rootViewController的帖子的窗口,有时据说保持相同的rootViewController整个应用程序的生命周期比切换它更好,其他帖子与更改rootViewController有关在应用程序的某个时刻。我对此感到困惑,并且在Apple的文档中找不到关于这一点的任何建议。当您可能在一个应用程序中有不同的内容ViewController时,最佳做法应该是什么?例如,假设您有一个选项卡式应用程序(UITabBarController),您希望首先显示欢迎View以供登录或注册(UINavigationController):1)使用固定的方法rootVi

ios - AppDelegate window.rootViewController 属性

我的iOS应用程序有问题。它基于Storyboard。因此,要设置rootViewController属性,将InterfaceBuilder中的“InitialViewController”属性和项目设置中的MainInterface-Property设置为我的Storyboard的名称就足够了。我仍然总是收到消息“应用程序窗口应该在应用程序启动结束时有一个RootViewController”。我在applicationDidFinishLaunching部分做了几件事,但即使除了返回YES之外的所有内容;被注释掉了,我收到了消息。我该如何解决这个警告?或者我可以在一切正常时忽略它

ios - 从消息弹出窗口导航到 RootViewController 时应用程序崩溃

我使用MFMessageComposeViewController类来发送消息。我的应用程序在特定情况下崩溃了。即,当MessageUI弹出窗口出现时,用户按下主页按钮,应用程序进入后台,当返回时,我编写了代码以导航到applicationDidBecomeActive委托(delegate)中的rootviewcontroller。如果有任何建议,请告诉我? 最佳答案 在appdelegate中,您正在分配rootviewcontroller,而在applicationDidBecomeActive中,您正在重定向到rootvie