How to add imageview on right hand side of action bar?

后端 未结 5 1958
星月不相逢
星月不相逢 2021-01-30 05:53

I want to add image view on action bar right hand side.I tried to do that but i couldn\'t. Can anyone help me?

This is my image view xml

 

        
5条回答
  •  自闭症患者
    2021-01-30 06:04

    You don't need an ImageView for this. Using a new item using Icon for your image will be the smartest solution.

    Add this item to your menu.xml:

    
    

    Instantiate the menu in onCreateOptionsMenu and implement it in onOptionsItemSelected.

提交回复
热议问题