草庐IT

UINavigationcontroller

全部标签

ios - 更改 UINavigationBar 后退按钮标题

在我的应用程序中,我想使用“后退”文本作为每个ViewController的后退按钮标题。我在stackoverflow上阅读了很多帖子,但一无所获。我不想设置leftbarbuttonitem。谁能帮我完成这个简单的任务。谢谢, 最佳答案 在父ViewController中而不是在subviewController中执行此操作swiftnavigationItem.backBarButtonItem=UIBarButtonItem(title:"Back",style:.plain,target:nil,action:nil)ob

ios - 更改 UINavigationBar 后退按钮标题

在我的应用程序中,我想使用“后退”文本作为每个ViewController的后退按钮标题。我在stackoverflow上阅读了很多帖子,但一无所获。我不想设置leftbarbuttonitem。谁能帮我完成这个简单的任务。谢谢, 最佳答案 在父ViewController中而不是在subviewController中执行此操作swiftnavigationItem.backBarButtonItem=UIBarButtonItem(title:"Back",style:.plain,target:nil,action:nil)ob

ios - 在 Swift 的导航 Controller 中弹出 2 个 View Controller

我找到了很多使用Objective-C在UINavigationController中弹出2个UIViewControllers的方法,但是当我尝试将其切换到Swift时,它似乎并没有正在工作。返回UIViewController的最佳方法是什么?任何指导将不胜感激谢谢 最佳答案 扩展我的评论,在viewControllers数组中找到倒数第二个ViewController,然后使用popToViewController来避免覆盖整个ViewController堆栈。示例(假设导航Controller有超过1个ViewControl

ios - 在 Swift 的导航 Controller 中弹出 2 个 View Controller

我找到了很多使用Objective-C在UINavigationController中弹出2个UIViewControllers的方法,但是当我尝试将其切换到Swift时,它似乎并没有正在工作。返回UIViewController的最佳方法是什么?任何指导将不胜感激谢谢 最佳答案 扩展我的评论,在viewControllers数组中找到倒数第二个ViewController,然后使用popToViewController来避免覆盖整个ViewController堆栈。示例(假设导航Controller有超过1个ViewControl

iphone - NSGenericException',原因 : 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

所以我正在制作一个包含5个ViewController的应用程序,第一个嵌入在UINavigationController中,前4个ViewController之间的连接工作正常。然而,引入第5个ViewController打破了这一点,我收到了错误Terminatingappduetouncaughtexception'NSGenericException',reason:'PushseguescanonlybeusedwhenthesourcecontrollerismanagedbyaninstanceofUINavigationController.'我对这个第5个ViewCo

iphone - NSGenericException',原因 : 'Push segues can only be used when the source controller is managed by an instance of UINavigationController

所以我正在制作一个包含5个ViewController的应用程序,第一个嵌入在UINavigationController中,前4个ViewController之间的连接工作正常。然而,引入第5个ViewController打破了这一点,我收到了错误Terminatingappduetouncaughtexception'NSGenericException',reason:'PushseguescanonlybeusedwhenthesourcecontrollerismanagedbyaninstanceofUINavigationController.'我对这个第5个ViewCo

iOS7 UIModalTransitionStyleFlipHorizo​​ntal 在过渡后反弹

我正在为iOS7更新我的应用程序,我发现了一个奇怪的问题。我正在使用UIModalTransitionStyleFlipHorizo​​ntal展示一个包裹在UINavigationController中的UIViewController。在iOS6中,它工作正常,但在iOS7中,导航栏在转换后跳动。这跟状态栏有关系吗?我已将主导航栏的半透明设置为NO。在Info.plist中,Viewcontroller-basedstatusbarappearance设置为NO。这是一个显示最小演示应用程序问题的GIF:这是我的代码:feedNavigationController=[[UINav

iOS7 UIModalTransitionStyleFlipHorizo​​ntal 在过渡后反弹

我正在为iOS7更新我的应用程序,我发现了一个奇怪的问题。我正在使用UIModalTransitionStyleFlipHorizo​​ntal展示一个包裹在UINavigationController中的UIViewController。在iOS6中,它工作正常,但在iOS7中,导航栏在转换后跳动。这跟状态栏有关系吗?我已将主导航栏的半透明设置为NO。在Info.plist中,Viewcontroller-basedstatusbarappearance设置为NO。这是一个显示最小演示应用程序问题的GIF:这是我的代码:feedNavigationController=[[UINav

iphone - 从导航堆栈中删除 View Controller

我有一个导航堆栈,其中包含5个UIViewController。我想通过单击第5个ViewController中的按钮来删除堆栈中的第3个和第4个ViewController。是否有可能做到这一点?如果是怎么办? 最佳答案 使用此代码并享受:NSMutableArray*navigationArray=[[NSMutableArrayalloc]initWithArray:self.navigationController.viewControllers];//[navigationArrayremoveAllObjects];//

iphone - 从导航堆栈中删除 View Controller

我有一个导航堆栈,其中包含5个UIViewController。我想通过单击第5个ViewController中的按钮来删除堆栈中的第3个和第4个ViewController。是否有可能做到这一点?如果是怎么办? 最佳答案 使用此代码并享受:NSMutableArray*navigationArray=[[NSMutableArrayalloc]initWithArray:self.navigationController.viewControllers];//[navigationArrayremoveAllObjects];//