简体   繁体   中英

Setting custom image view as action bar's menu icon

I would like to add one of the menu icons of the action bar as below.

在此输入图像描述

I need an icon and a bubble on top of that and I need to display a number on that at run time. Is it possible to do? I have Googled regarding this, but couldn't find exact way to do.

Thanks in advance.

what you want is call "badge"

A simple way to "badge" any given Android view at runtime without having to cater for it in layout.

try this Lib

https://github.com/jgilfelt/android-viewbadger

您必须为此处的教程中提到的操作栏定义自定义布局,并在Imageview上方显示计数器,可以使用Android通知类。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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