草庐IT

UINavigationController-Alike

全部标签

ios - 如何在 UINavigationController 中获得弹出 View 的通知?

我想在用户到达某个UIViewController时按下我的UINavigationController上的后退按钮时执行操作。不幸的是,UINavigationControllerDelegate似乎没有任何方法来获取弹出View的通知。作为解决方法,我现在在viewDidDisappear方法中使用我的操作,只有当animated为YES时才会触发。这可行,但有点难看。我应该如何正确执行此操作? 最佳答案 从导航ViewController(以及模态)处理弹出的最流行方法是为您的ViewController实现viewWillD

ios - UINavigationController 在转换到另一个 VC 时删除阴影

当使用UINavigationController和pushViewController:animated:将另一个ViewController插入堆栈时,在转换过程中总会显示一个投影:我有一个在导航Controller上有视频背景的应用程序,所以我想删除那个投影,因为它在过渡期间看起来很奇怪。有什么办法可以彻底去除吗?(我不是在谈论UINavigationBar影子) 最佳答案 解决方法://setoneofviewcontrollers(usualfirst)asnavigationControllerdelegateclass

ios - 后退按钮在 UINavigationController 中奇怪地消失但继续工作

在iOS7下,如果设置了特定的背景图片,我会遇到后退按钮项目不会显示的问题:intimageSize=21;//REPLACEWITHYOURIMAGEWIDTH[[UIBarButtonItemappearance]setBackButtonTitlePositionAdjustment:UIOffsetMake(-400.f,0)forBarMetrics:UIBarMetricsDefault];UIImage*barBackBtnImg=[[UIImageimageNamed:@"BackArrowDark.png"]resizableImageWithCapInsets:UI

ios - 为什么 UINavigationController 和 UIViewControllers 之间没有保留循环

情况:有UINavigationController和推送的UIViewController。1.UIViewController强引用UINavigationController@property(nonatomic,readonly,retain)UINavigationController*navigationController2.UINavigationController将ViewController存储在NSArray中@property(nonatomic,copy)NSArray*viewControllers;UINavigationController应该对这个N

ios - 如何 "pop"UINavigationController 堆栈中的几个 View Controller ?

在我的应用程序中,我正在实现UINavigationController。有几个UIViewControllers被压入堆栈。当我到达最后一个时,我希望(根据用户操作)弹出除第一个UIViewController之外的所有UIViewController。我该怎么做?我知道如何弹出最后一个,但我如何指示所有前面的也消失? 最佳答案 您可以尝试UINavigationControllerclass的popToRootViewControllerAnimated:、popToViewController:animated:和popVie

ios - 是否可以弹出 UINavigationController 两次?

这个问题在这里已经有了答案:HowdoIpoptwoviewsatoncefromanavigationcontroller?(18个答案)关闭8年前。是否可以弹出导航Controller两次?我有这个导航结构:观点一---->观点二---->观点三我想要完成的是,通过点击View三上的一行,直接返回到View一。我已经通过协议(protocol)委托(delegate)从三到二完成了它,但是在View中设置委托(delegate)一个不起作用并设置两个连续的委托(delegate)协议(protocol)都弹出导航Controller,给我错误:嵌套导航Controller事件(或类

ios - 如何跳转到另一个 UINavigationController 中的任何 ViewController

我有一个使用Storyboard创建的项目。我有很多ViewControllers,与segues相连。现在我想从ViewController(下面的VC)A获取,它嵌入在navigationController(作为RootVC)中,并由另一个VCB(也由另一个VCC模态地呈现)以模态转场呈现给任何其他VCStoryboard中的D(在本例中是主导航ControllerE中的第一个)。我经历过NavigationController层次结构被模态segue“破坏”,并且因为我需要在VCA中使用pushsegue的功能,所以我需要使用第二个NavigationController...

ios - 在 IOS 中自定义 UINavigationBar 而不使用 UINavigationController 设置背景图像不起作用

我是IOS新手。所以我尝试在不使用导航Controller的情况下自定义UINavigationBar。我可以更改图block和背景颜色,但我已尝试以编程方式设置背景图像,但它不起作用。是否可以使用Storyboard本身设置背景图像?我已经尝试过大多数以编程方式使用的网站。那么有什么方法可以使用UIStoryboard设置背景图像吗? 最佳答案 我们可以这样做你得到了的输出注意如果您从Assests加载图像,请使用UIImage(named:"xx")ifletimg=UIImage(named:"xx"){self.topBar

swift - prepareForSegue 使用 UINavigationController 切换……更好的方法?

我有几个segues呈现模态视图Controller。classProfileViewController:UIViewController{funcconfigure(profile:Profile){//SomeProfileViewControllerspecificconfig}}classSettingsViewController:UIViewController{funcconfigure(settings:Settings){//SomeSettingsViewControllerspecificconfig}}所以这里有一些我们都写过很多次的非常标准的代码......

ios - 在 Swift 中转换从 UINavigationController 中提取的 viewController

我在UINavigationController中有UIViewController。这个ViewController实现了一个协议(protocol)。我正在尝试获取导航堆栈的第一个Controller并对其进行转换:ifletvc=_navigationStack.viewControllers?[0]as?ExplorerInterface{returnvc}但我收到错误:Cannotdowncastfrom'AnyObject?'到非@objc协议(protocol)类型“ExplorerInterface”。我正在寻找一种无需将@objc关键字添加到我的协议(protocol