简体   繁体   English

NavigationBar 右键问题

[英]NavigationBar Right Button Problem

I have a navigation bar in my app.我的应用程序中有一个导航栏。 The below pictures are in the order of navigation.以下图片按导航顺序排列。

Problem I have is, on clicking the "Main" button, I am able to perform the action and goto the required screen, but the navigation bar does not look like the first on (with Menu as left button).我遇到的问题是,在单击“主”按钮时,我能够执行操作并转到所需的屏幕,但导航栏看起来不像第一个(菜单作为左按钮)。 Instead it look like 4th image.相反,它看起来像第四张图片。 How to make it look like first image so that I can make the user to navigate to "Menu" screen by clicking menu button?.如何使它看起来像第一张图片,以便我可以让用户通过单击菜单按钮导航到“菜单”屏幕? Thanks for the help …!!!谢谢您的帮助 …!!!

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

If I'm understanding this correctly, you may have pushed the first view controller (The one from screenshot 1) when clicking on main which is why you see "lens" in the back button.如果我理解正确,您可能在单击 main 时推送了第一个视图 controller(屏幕截图 1 中的那个),这就是您在后退按钮中看到“镜头”的原因。 That back button takes the title of the previous view controller in the stack.该后退按钮采用堆栈中上一个视图 controller 的标题。 What you want to do is pop to the first view controller when they click on Main using either popToRootViewController or popToViewController:animated当他们使用 popToRootViewController 或 popToViewController:animated 单击 Main 时,您想要做的是弹出到第一个视图 controller

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM