如何在基于选项卡的应用程序中设置导航栏上的按钮?

发布于 2024-11-26 22:33:06 字数 237 浏览 4 评论 0原文

我正在开发一个涉及两种应用程序的项目,即基于导航和基于选项卡的应用程序。一切都运转良好。但我想要的是,当我单击特定选项卡时,必须将一个按钮添加到顶部的导航栏以编辑其下方的表格。我可以绘制按钮,但它不会影响其下方的表格视图。当我在基于导航的应用程序中执行此操作时,它工作得很好。但它不适用于基于选项卡的情况。

因此,请告诉我如何在基于 UI 选项卡的应用程序中的导航栏中添加仅出现在特定选项卡上的按钮。

告诉我示例代码或任何教程。

I am working on a project which involves both kind of applications ie Navigation based and Tab based. All things are working perfectly. But what I want is, when I click on a particular tab then a button must be added to the navigation bar at the top to edit the table below it. I am able to draw the button but it is not affecting the tableview below it. When I do this in navigation based application it works perfectly. But it does not work in tab based.

So please tell me the way to add button at navigation bar in UI tab based application which appear only at particular tab.

tell me the sample code or any tutorial for it.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

沫离伤花 2024-12-03 22:33:06

对于每个选项卡,嵌入一个 UINavigationConrtoller 以及您自己的视图控制器。

这样,每个选项卡都会有自己的导航栏,因此可以有自己的栏项目、标题等集。

您通常不想在 UINavigationController 中嵌入 UITabBarController >,总是相反。

For each tab embed a UINavigationConrtoller, and your own view controllers in them.

This way each tab will have its own navigation bar, and thus can have their own sets of bar items, titles, etc.

You generally never want to embed a UITabBarController in a UINavigationController, always the other way around.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文