Add Icon after Text Label In Bottom Navigation

时间:2019-04-08 13:22:52

标签: android bottomnavigationview

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. Is there any way?

Current

enter image description here

Looking For

enter image description here

1 个答案:

答案 0 :(得分:0)

这是我为实现所寻找的目标而要做的。这是我发现的最简单的方法,无需使用任何繁重的编码或库。

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));