在底部导航栏图标的顶部显示徽章 [英] Display badge on top of bottom navigation bar's icon

查看:79
本文介绍了在底部导航栏图标的顶部显示徽章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的应用中实现了底部导航视图,并且已经在

I have implemented the bottom navigation view in my app and I have looked every where to display badges on top of the icons like this I was wondering whether this is even possible to implement. Any help is appreciated. Thank you.

推荐答案

在使用支持库底部导航栏时,它非常复杂,无法在菜单项上显示徽章/通知. 但是,有简单的解决方案可以完成它.如 https://github.com/aurelhubert/ahbottomnavigation

When using support library Bottom Navigation bar, its quite complex to show a badge/notification on menu items. However there are easy solutions to get it done. Such as https://github.com/aurelhubert/ahbottomnavigation

此库是底部导航"栏的更高级版本.您只需使用此代码段即可在菜单项上设置徽章.

This library is more advanced version of Bottom Navigation bar. And you can set a badge on menu item simply using this code snippet.

bottomNavigation.setNotification(notification, bottomNavigation.getItemsCount() - 1);

您将获得以下结果

这篇关于在底部导航栏图标的顶部显示徽章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆