TabBar徽章事件和变化

发布于 2024-10-27 23:11:33 字数 168 浏览 6 评论 0原文

我有一个选项卡栏,默认徽章计数为 6。当用户更改选项卡视图上按钮的值时,我希望调整徽章。 -1或+1。所有按钮都设置为红色,如果用户将值更改为绿色,则徽章会下降到 5。如果从绿色变为红色,则徽章会增加 1 到 6,依此类推。是否有一个事件来处理这个问题,或者我是否需要编写一个方法。有人可以帮忙吗?

谢谢。

I have a tabbar, with a default badge count of 6. When a user changes the value of a button on the tab view, I would like the badge to adjust. -1 or +1. All the buttons are set to red, if the user changes the value to green, then the badge goes down to 5. If the go from green to red, then the badge adds 1 to 6 and so on. Is there an event to handle this, or do I need to write a method. Could someone please help.

Thanks.

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

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

发布评论

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

评论(1

淡紫姑娘! 2024-11-03 23:11:33

我认为您可以尝试使用 UITabbarController 的委托方法

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;

,或者尝试手动调用它....&根据您的意愿设置徽章。

希望能解决您的问题。

I think you could try using the delegate method of UITabbarController

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController;

or either try to call it manually ....& set the badge,as per your wish.

Hope that could solve your problem.

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