在 UINavigationController 中触摸 leftBarButtonItem 后如何管理方法?

发布于 2024-08-22 07:32:34 字数 268 浏览 4 评论 0原文

我使用的是简单的 UINavigationController。 但如果我来自子 viewController,我想发生一些自定义事件。

例如, 如果 rootViewController 是 AA AA的subviewController是BB。 然后进入BB(通过pushViewController)。

然后,BB→AA。 这次,我想管理一个活动。

目前,我让它查看 UIBarButtonItem,但它的形状是 RECT。 (我想要五边形)

可以吗?

I was using simple UINavigationController.
but If I come from sub viewController, I want to occur a some custom event.

For example,
If rootViewController is AA
and subviewController of AA is BB.
and then enter the BB (by pushViewController).

and then, BB->AA.
this time, I want to manage a event.

currently, I made it view UIBarButtonItem, but Its shape is RECT. (I want pentagon)

Is it possible?

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

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

发布评论

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

评论(2

画中仙 2024-08-29 07:32:34

在BB的-viewWillDisappear:中,设置一个全局标志。

然后在AA的-viewWillAppear:中,检查是否设置了全局标志。如果是,请管理您的事件,然后清除标志。

In BB's -viewWillDisappear:, set a global flag.

Then in AA's -viewWillAppear:, check if the global flag is set. If yes, manage your event, then clear the flag.

書生途 2024-08-29 07:32:34

让BB成为AA和BB所在的UINavigationController的委托。然后实现navigationController:willShowViewController:animated:委托方法并检查传入的viewController是否是AA。

Make BB become the delegate of the UINavigationController AA and BB are in. Then implement the navigationController:willShowViewController:animated: delegate method and check if the viewController passed in is AA.

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