jjzjj

Navigationcontroller

全部标签

ios - 无法将 UIBarButtonItem 添加到工具栏

在针对这个问题检查了每一个stackoverflow解决方案之后,它仍然对我不起作用,这令人沮丧。//UIBarButtonItemdeclarationUIBarButtonItem*button1=[[UIBarButtonItemalloc]initWithTitle:@"ButtonText"style:UIBarButtonItemStyleBorderedtarget:selfaction:@selector(myAction)];//method1[selfsetToolbarItems:[NSArrayarrayWithObjects:button1,nil]anima

iOS 7 : UINavigationBar out of sync with UINavigationController

我有以下代码:NSArray*stack=self.navigationController.viewControllers;NSArray*newStack=@[stack[0],stack[2]];[self.navigationControllersetViewControllers:newStackanimated:NO];stack包含3个ViewController。问题是导航栏没有删除UINavigationItems以匹配,因此self.navigationController.navigationBar.items.count在运行此代码后仍然返回3。返回会让您进入一

ios - 在工具栏/标签栏之间交替

我的应用程序结构如下:UITabBarController>UINavigationController>ViewControllerOne>ViewControllerTwo。UINavigationBar在底部有标签栏,现在当用户导航到第二个ViewController时,我希望能够隐藏标签栏并用工具栏替换。我试过这段代码:[self.navigationController.tabBarController.tabBarsetHidden:YES];[self.navigationController.toolbarsetHidden:NO];当我运行应用程序时,选项卡栏被隐藏,

ios - UITabbar 项目在升级到 Xcode 7 后单击后才会显示

我有一个UITabBar,它在我升级到Xcode7之前运行良好,但现在我无法弄清楚我的生活发生了什么。我尝试了几种解决方案,包括为我创建的每个选项卡设置imageWithRenderingMode,尝试更改UITabBar的背景颜色以查看项目是否只是白色,以及将图标本身更新为新版本。我默认选择的选项卡显示得很好,然后当我选择另一个选项卡时,显示文本,但没有图像。(移动到另一个选项卡时,文本仍然存在并更改为默认灰色。)我附上了我所看到的屏幕截图,这是我目前实现标签栏的方式。创建tabbar的函数:voidMakeTabBar(idtarget){PFUser*currentUser=[P

ios ~ 设置BaseViewcontroller:两种方法(系统、自定义)

首页跳转下一页的时候,push前隐藏底下的tabBarGWTeamInfoViewController*teamInfoVC=[[GWTeamInfoViewControlleralloc]initWithTeamId:teamId];[teamInfoVCsetHidesBottomBarWhenPushed:YES];//跳到下一页,隐藏底下的tabBar[self.navigationControllerpushViewController:teamInfoVCanimated:YES];注意:侧滑返回上一页(在基类的viewDidAppear中设置YES可侧滑,在禁止侧滑的VC中的vi

ios - 实例化ViewControllerWithIdentifier并传递数据

我在我的应用程序中使用Storyboard,我想将数据从一个View传递到另一个View。我没有使用segues,而是使用instantiateViewControllerWithIdentifier。在这种情况下,我从我的第一个TableViewController实例化到一个NavigationController,它附加了第二个TableViewController因为我需要第二个中的导航>TableViewController。现在我想将数据从我的第一个TableviewController传递到我的第二个TableviewController,具体取决于单击的行。在这种情况下

ios - 模仿 iOS 7 Safari 导航栏

在iOS7中,Safari中的导航栏在滚动时会自动缩小。Facebook中的导航栏也是如此,甚至到了完全消失的地步。您将如何自己实现此行为?我想您还必须动态调整contentOffset,我想这也会与默认的刷新控件发生冲突,不是吗? 最佳答案 这不是正确的做法,但它对我有用。我在UINavigationBar上创建了类别并覆盖了sizeThatFits:,如下所示:-(CGSize)sizeThatFits:(CGSize)size{CGSizecSize=self.frame.size;BOOLisPortrait=UIInter

ios - 隐藏 UINavigationBar 但仍显示状态栏

如何通过不隐藏我的应用程序中的状态栏来隐藏导航栏?当我尝试[self.navigationController.navigationBarsetHidden:YES];它也隐藏了状态栏。我需要像这样显示状态栏:我需要先隐藏一个可见的导航栏,使状态栏仍然可见,我还有一个View需要移动到状态栏下方,但是View的定位就像导航栏仍然存在一样,当我将框架的位置设置为0,0。我将状态栏设置为:[[UIApplicationsharedApplication]setStatusBarHidden:NO];[[UIApplicationsharedApplication]setStatusBarS

iphone - 奇怪的错误 : wait_fences: failed to receive reply: 10004003

我知道还有其他问题可以解决此错误,但这些答案对我没有任何帮助。我想知道是否有人知道确切原因,如果没有人知道,这里是代码:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingImage:(UIImage*)imageeditingInfo:(NSDictionary*)editingInfo{self.imageView.image=image;[pickerdismissModalViewControllerAnimated:YES];[pickerrelease];//[selfmy

iphone - 为什么这个不同的 "addSubView"代码会导致行为差异

为什么将以下代码从旧条目更改为新条目可以解决以下问题。代码://OLDEntry-Didnotwork//[self.windowaddSubview:navigationController.view];//NEWEntry-Fixeditself.window.rootViewController=self.navigationController;使用旧代码时出现的问题:我正在使用UINavigationController并有一个“mainView”UITableViewController,然后我将一个二级View插入堆栈,我们称它为“detailedView”UITable