简体   繁体   English

在底部导航中添加文本标签后的图标

[英]Add Icon after Text Label In Bottom Navigation

I am not able to find a way to add little Red Dot just after bottom navigation label as in image. 我无法在图像底部导航标签之后找到添加小红点的方法。

Currently it is having Icon + label and I wan to add red dot. 目前它有Icon +标签,我想添加红点。 Is there any way? 有什么办法吗?

Current 当前

在此输入图像描述

Looking For 寻找

在此输入图像描述

This what I have done to achieve what I was looking for. 这就是我为实现我所寻求的目标所做的一切。 This is the most simpler way I found without using any heavy coding or library. 这是我在不使用任何繁重的编码或库的情况下找到的最简单的方法。

Menu menu = navigation.getMenu();
MenuItem live_one = menu.findItem(R.id.navigation_live_one);
MenuItem live_two = menu.findItem(R.id.navigation_live_two);

String text = "<font color='white'>Live</font> <font color='red'>&#11044;</font>";
live_one.setTitle(Html.fromHtml(text));
live_two.setTitle(Html.fromHtml(text));

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

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