Action Bar not showing action view icons

后端 未结 2 668
走了就别回头了
走了就别回头了 2020-12-03 07:10

I\'m using the new Action Bar Support and all my action views are shown in overflow and not as icons in the bar. My app is for 7+ API.

HomeActivity:

         


        
2条回答
  •  生来不讨喜
    2020-12-03 07:17

    A common mistake is forgetting to include the title string in your string.xml file. Make sure you include it for each menu item.

    Suppose our menu xml contains the following item :

        
    

    If we forget to include the value for the string toggle_action, then the action bar icon will not show.

    Go to your strings.xml file and add in the following:

        TOGGLE
    

提交回复
热议问题