草庐IT

UINavigationController-Alike

全部标签

iphone - UINavigationController - 在所有 View 中保留背景图像

有没有办法让背景图像在导航Controller的所有View中保持不变?目前,我在每个View的viewDidLoad方法中加载相同的背景,但这显示了在从一个View导航到另一个View时背景图像移动。我宁愿只是背景“幻灯片”开/关屏幕的View前面的内容,但背景保持静止。这是我当前的背景图片加载代码:UIImageView*background=[[UIImageViewalloc]initWithFrame:CGRectMake(0,0,320,460)];background.image=[UIImageimageNamed:@"InfoBackground.png"];[sel

iOS:无法将 UISplitViewController 推送到 UINavigationController

我有一个使用导航Controller的XCodeiPad项目。我试图获取一个按钮以将UISplitViewController推送到导航堆栈,但出现此错误:SplitViewControllerscannotbepushedtoaNavigationController原来UISplitViewController不能很好地与UINavigationController配合使用。但是,我仍然需要在单击此按钮时显示SplitViewController。我该怎么做呢?而且,同样重要的是,我如何制作后退按钮以便用户可以返回到导航Controller? 最佳答案

ios - UINavigationController 如何设置标题

我有一个用于通用项目列表的Controller/View,可以扩展它以显示自定义列表。列表和导航工作正常。但我无法更改UINavigationController的标题。在通用Controller中:-(void)viewDidLoad{[superviewDidLoad];[self.viewaddSubview:navigationController.view];}-(void)setNavigationTitle:(NSString*)title{NSLog(@"settitle:%@",title);//thisworksself.navigationController.t

iphone - 如何访问 UINavigationController 中的堆栈

viewControllersTheviewcontrollerscurrentlyonthenavigationstack.@property(nonatomic,copy)NSArray*viewControllersDiscussionTherootviewcontrollerisatindex0inthearray,thebackviewcontrollerisatindexn-2,andthetopcontrollerisatindexn-1,wherenisthenumberofitemsinthearray.Assigninganewarrayofviewcontroll

iphone - 如何以编程方式为 UINavigationController 子类化 UINavigationBar?

我在iOS4中的应用程序中使用自定义drawRect函数在UINavigationBar上绘制,它不使用图像,仅使用CoreGraphics。由于你不能在iOS5的UINavigationBar类别中实现drawRect,Apple建议将UINavigationBar子类化。当navigationBar属性是只读的?@property(nonatomic,readonly)UINavigationBar*navigationBar我根本没有在我的应用程序中使用XIB,因此将UINavigationBar添加到NIB并通过InterfaceBuilder更改类不是一个选项。

ios - 更改 UINavigationController 标题的字体

我可以更改UINavigationController的字体吗?-->标题 最佳答案 从iOS5开始,您可以通过外观代理更改字体。https://developer.apple.com/documentation/uikit/uiappearance以下将为所有UINavigationControllers设置标题字体。NSMutableDictionary*titleBarAttributes=[NSMutableDictionarydictionaryWithDictionary:[[UINavigationBarappeara

ios - UINavigationController 交互式弹出手势不起作用?

所以我在为iOS7构建的应用程序中有一个导航Controller。titleView是可见的,后退按钮和导航栏也是可见的。出于某种原因,交互式弹出手势(从左边缘滑动)不起作用。什么都没发生。当我记录手势时,它不是零。要启用此功能,我需要做什么特别的事情吗?什么会导致它不起作用? 最佳答案 我发现当使用自定义后退按钮时,交互式弹出手势停止工作(我的看法是Apple无法预见您的自定义后退按钮的行为方式,因此他们禁用了该手势)。如前所述,要解决此问题,您可以将interactivePopGestureRecognizer.delegate

iphone - 向 UINavigationController 中的所有 View Controller 添加相同的按钮

我有一个UINavigationController(像向导页面一样使用),我以编程方式创建它,我需要显示一个“取消”按钮以取消任何UIViewController中的进程.创建UINavigationController:FirstVC*firstVC=[[[FirstVCalloc]initWithNibName:@"FirstPage"bundle:nil]autorelease];firstVC.delegate=self;navigationController=[[UINavigationControlleralloc]initWithRootViewController:

ios - 如何更改 UINavigationController 后退按钮名称?

我有一个UIViewController,我正在从我的第一个ViewController导航到第二个ViewController,我想更改navigationcontroller上显示的按钮的名称回去....SecondViewController*secondController=[[SecondViewControlleralloc]initWithNibName:nilbundle:NULL];[self.navigationControllerpushViewController:secondControlleranimated:YES];现在在第二个viewcontrolle

ios - UINavigationController "pushViewController:animated"的完成处理程序?

我打算使用UINavigationController创建一个应用程序来呈现下一个ViewController。在iOS5中,有一种呈现UIViewControllers的新方法:presentViewController:animated:completion:现在我问我为什么UINavigationController没有完成处理程序?只有pushViewController:animated:是否可以创建我自己的完成处理程序,如新的presentViewController:animated:completion:? 最佳答案