草庐IT

UINavigationController-Alike

全部标签

ios - 没有导航栏的 UINavigationController?

我有一个通用应用程序,在iPad版本上我使用UISplitViewController创建一个类似于邮件应用程序的界面。我在推送新的DetailView时遇到了问题,所以我决定使用UINavigationController这样我就可以根据需要推送和弹出View。但是,我不想使用导航View或工具栏。但是无论我做什么,我都无法隐藏导航栏。我试过取消选中IB中的“显示导航栏”,我也试过设置:[self.navigationControllersetNavigationBarHidden:YES];在viewDidLoad/viewDidAppear/viewWillAppear中。我也在

ios - UINavigationController "back button"自定义文本?

默认情况下,UINavigationController的“后退按钮”显示堆栈中最后一个View的标题。有没有办法在后退按钮中使用自定义文本? 最佳答案 来自thislink:self.navigationItem.backBarButtonItem=[[UIBarButtonItemalloc]initWithTitle:@"CustomTitle"style:UIBarButtonItemStylePlaintarget:nilaction:nil];正如泰勒在评论中所说:don'tdothisinthevisibleviewc

ios - 如何在 UINavigationController 中隐藏 "back"按钮?

你知道如何在UINavigationController中隐藏“后退”按钮吗?另外,如何显示它,但我想这与隐藏它非常相似......就像您在查看电子邮件时点击“编辑”时邮件应用程序在iPhone上所做的那样。 最佳答案 我刚找到答案,在Controller中使用这个:[self.navigationItemsetHidesBackButton:YESanimated:YES];并恢复它:[self.navigationItemsetHidesBackButton:NOanimated:YES];--[更新]swift3.0:self

iphone - 如何向 UINavigationController 添加右键?

我试图将刷新按钮添加到导航Controller的顶部栏,但没有成功。这是标题:@interfacePropertyViewController:UINavigationController{}这是我尝试添加它的方式:-(id)initWithNibName:(NSString*)nibNameOrNilbundle:(NSBundle*)nibBundleOrNil{if(self=[superinitWithNibName:nibNameOrNilbundle:nibBundleOrNil]){UIBarButtonItem*anotherButton=[[UIBarButtonIt

ios - 如何在没有 UINavigationController 的情况下使 Segue 动画水平?

我使用的是UISplitViewController,带有MasterViewController和DetailViewController,没有UINavigationController。目前master->detail的segue动画,由触发performSegueWithIdentifier("showDetail",sender:self)包含从底部向上显示的DetailViewController。如何制作向左显示的动画? 最佳答案 我最近需要更好地控制segue的执行方式,因此我制作了自定义的segue类,它们都在不同

ios - UINavigationController子类方便初始化使子类常量init两次

我有UINavigationController和UITableViewController的子类。为了初始化子类,我决定使用一些convenienceinit方法来调用父类(superclass)的一些指定初始化程序。此外,每个子类都有一些let常量:letsomeValue:SomeClass=SomeClass()每个类都通过调用其新创建的convenienceinit方法成功初始化。问题是let常量在UINavigationController子类中初始化了TWICE。importUIKitimportPlaygroundSupportfinalclassNavigation:

xcode - 无法转换类型 'UINavigationController' 的值

我正在为我的应用程序实现一个搜索界面,所以基本上我会将搜索关键字从一个ViewController传递到另一个ViewController。我已经多次完成这种类型的参数传递,但这次似乎有些奇怪。目标ViewController嵌入在导航Controller中。现在代码看起来像这样。overridefuncprepareForSegue(segue:UIStoryboardSegue?,sender:AnyObject!){if(segue?.identifier=="home_to_search"){varsearchKeyword=txtSearchBarHome.textvarsv

ios - 如何获取 UINavigationController 的 rootViewController

我想获取UINavigationController的rootViewController。它在Objective-c中有效,但是当我在Swift中使用它时,错误提醒我它是错误的。Codescreenshot1.如果我这样做,添加as!NSArray,它有效,但也提醒我“从‘[UIViewController]’转换为无关类型‘NSArray’总是失败”。Codescreenshot2有人可以展示一种更好的方法来无错误地获取`rootViewController``吗?谢谢。 最佳答案 你可以通过以下方式获取根self.naviga

ios - 在 UINavigationController 中,topViewController、visibleViewController、presentedViewController 之间有什么区别?

UINavigationController有3个Controller,听起来都与我非常相似:topViewController、visibleViewController和presentedViewController。您在哪些场景中使用这些Controller? 最佳答案 topViewController-最后一个ViewController使用UINavigationController的pushViewController(_:animated:)方法推送到UINavigationController。将之前的Contro

ios - 如何正确关闭显示为模态的 UINavigationController?

在我的TabBarViewController中,我创建了一个UINavigationController并将其显示为模式。varnavController=UINavigationController()letmessageVC=self.storyboard?.instantiateViewControllerWithIdentifier("MessagesViewController")as!MessagesViewControllerself.presentViewController(self.navController,animated:false,completion:n