草庐IT

UINavigationcontroller

全部标签

ios - 当前 View 重叠 UINavigationController 的导航栏

我正在为我的应用设计一个注册页面View,以编程方式,用户可以在其中输入自己的图像和一些信息。在我的LoginController中,我创建了一个UINavigationController,其中包含我的RegisterController的RootViewController,然后显示。funchandleRegisterButtonClicked(){letregisterController=RegisterController()letnavController=UINavigationController(rootViewController:registerControll

ios - UINavigationController 在 swift 3 中为 nil

在我的主Storyboard中,我有1个导航Controller和后续的swift文件NavigationCtr.swift。viewController在不同的xib中。现在我想从NavigationCtr类推送我的viewController。letvcFirst=FirstViewController(nibName:"FirstViewController",bundle:nil)self.navigationController!.pushViewController(vcFirst,animated:true)我遇到了异常fatalerror:在展开可选值时意外发现nil所

ios - UINavigationController:确定后退按钮是否被按下或 popViewController 动画

在UINavigationController中,如果当前viewcontroller因用户按下后退按钮而被关闭,或者如果ViewController被popViewControllerAnimated以编程方式关闭,是否有按钮的方法?注意:我特别想区分这两个事件。这不是thisquestion的不重复因为我试图找出调用了哪个事件,而不是ViewController被关闭的时间澄清:我想弄清楚View是否正在消失,因为a)后退按钮被按下或b)调用了popViewControllerAnimated 最佳答案 在viewWillDis

ios - 如何确保我的详细信息 View Controller 始终嵌入到 UINavigationController 中?

我有一个UISplitViewController,它有一个preferredDisplayMode=.AllVisible。Here这就是我设置Storyboard的方式,请注意细节ViewController是如何嵌入到UINavigationController中的。当点击主视图Controller的toolBar中的特定按钮时,我执行以下方法:@IBActionfuncentertainmentBarButtonItemTapped(sender:AnyObject){self.showDetailViewController(self.storyboard!.instanti

ios - 如何获取呈现 UINavigationController 的 UIViewController

我有NAVIGATIONControllerA->ViewControllerA->ViewControllerB||(modal)|\/'NAVIGATIONControllerB->ViewControllerC如何从C返回到ViewControllerA?当我在ViewControllerC中时,我尝试打印不同的Controller值:print(self.navigationController)//NAVIGATIONControllerBprint(self.navigationController?.presentingViewController)//UINavigat

ios - 使用 UINavigationController 弹出顶 View 时不再调用 viewDidLayoutSubviews

iOS10,这个断断续续的礼物,似乎又换了一个行为。假设两个UIViewController被推送到一个UINavigationController上。在iOS8/9上,调用navigationController?.popViewController(animated:true)弹出顶部UIViewController(例如VC2)导致底部ViewController上的viewDidLayoutSubviews(说VC1)被叫。我们就是靠这个来刷新VC1的。有时VC2会向VC1添加subview(通过数据模型),这需要在弹出回VC1时得到反射(reflect)。需要准确的帧信息。我

ios - 介绍 UINavigationController Swift

我正在展示一个加载屏幕,我不想在其中显示导航栏。所以我用self.navigationController.navigationBar.hidden=true它可以隐藏导航栏。但是当我想显示导航栏时,我想在其中添加动画。我试过使用这段代码,但没有出现该栏。self.navigationController.setNavigationBarHidden(false,animated:true)运行上面的代码后,栏仍然隐藏,我怎样才能显示/动画栏? 最佳答案 我认为你的方法已经是正确的了。您只需要知道将代码放在哪里。试试下面的代码。Vi

ios - UINavigationController 与 ViewController 内容重叠

在我的应用程序中,我使用视觉自定义的NavigationController来处理页面流。默认情况下,导航栏出现在顶部,ViewController的内容就在它的下方。然而,我想要实现的是,viewcontroller的实际内容从屏幕顶部开始,而不是在导航栏下方。所以目前它看起来像(绿色是导航栏):我希望绿色与viewController重叠,我检查了所有导航栏bool值,但找不到正确的属性。任何帮助将不胜感激 最佳答案 您可能想检查ViewController的edgesForExtendedLayoutproperty的值,以及

ios - Swift 3 UIStatusBarStyle 不适用于 UINavigationController 中的单独 ViewController

Swift3中的某些内容发生了变化。我曾经能够在每个ViewController上将状态栏颜色从默认更改为亮起,即使它被包裹在UINavigationController中也是如此。现在我有一个UINavigationController来管理我所有的UIViewController,当我在每个ViewController上执行此操作时,它不会工作:overridevarpreferredStatusBarStyle:UIStatusBarStyle{return.lightContent}另一方面,当我将此代码插入我的UINavigationCotroller子类时,它可以工作,但我

swift - 在 UINavigationController 中更改 UINavigationBar 的约束

Apple在其Documentation中表示:ItispermissibletocustomizetheappearanceofthenavigationbarusingthemethodsandpropertiesoftheUINavigationBarclassbutyoumustneverchangeitsframe,bounds,oralphavaluesormodifyitsviewhierarchydirectly.他们从未严格提到不允许更改约束,但我假设它属于与更改框架相同的标准。我需要这个用于消息应用程序,以便在iMessage标准顶部栏下实现半透明效果。我目前拥有的