Custom views in actionbar

2019-04-10 11:15发布

I have an action bar. One of the items in the actionbar is for notifications. I want to add a little icon in the top right of the actionbar item which represents how many notifications the user currently has.

I went ahead and made a custom layout for the action bar item. Went to go add it and to my surprise there is no way for me to add a custom view as a button on a Action bar.

I am using Actionbar-Sherlock for compatibility to older device.

This is what I am going for:

enter image description here

1条回答
登录 后发表回答