How to show unread notification counter on Tabs inside TabLayout?

不想你离开。 提交于 2020-01-01 05:33:08

问题


I am using TabLayout of android support design library.

I want to show unread notification counter on the tab with title like below image.

How to set unread count on Tab inside TabLayout?


回答1:


Use public TabLayout.Tab setCustomView (int layoutResId)

Create a Layout with TextView and Button use this in Custom view.

For reference

setCustomView

Example

Hope this will helpful to you.




回答2:


Take a look at android-viewbadger...



来源:https://stackoverflow.com/questions/32269517/how-to-show-unread-notification-counter-on-tabs-inside-tablayout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!